Skip to content

Commit d145809

Browse files
committed
make items private
1 parent 6c4e0cb commit d145809

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

examples/app/log_layers_ecs.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
//! The way we will do this is via a [`mpsc`] channel. [`mpsc`] channels allow 2 unrelated
44
//! parts of the program to communicate (in this case, [`Layer`]s and Bevy's ECS).
55
//!
6-
//! Inside the [`update_subscriber`] function we will create a [`mpsc::Sender`] and a [`mpsc::Receiver`] from a
6+
//! Inside the `update_subscriber` function we will create a [`mpsc::Sender`] and a [`mpsc::Receiver`] from a
77
//! [`mpsc::channel`]. The [`Sender`](mpsc::Sender) will go into the `AdvancedLayer` and the [`Receiver`](mpsc::Receiver) will
88
//! go into a non-send resource called `LogEvents` (It has to be non-send because [`Receiver`](mpsc::Receiver) is [`!Sync`](Sync)).
9-
//! From there we will use [`transfer_log_events`] to transfer log events from `LogEvents` to an ECS event called [`LogEvent`].
9+
//! From there we will use `transfer_log_events` to transfer log events from `LogEvents` to an ECS event called `LogEvent`.
1010
//!
11-
//! Finally, after all that we can access the [`LogEvent`] event from our systems and use it.
11+
//! Finally, after all that we can access the `LogEvent` event from our systems and use it.
1212
//! In this example we build a simple log viewer.
1313
1414
use std::sync::mpsc;
@@ -23,17 +23,17 @@ use bevy::{
2323

2424
/// A basic message. This is what we will be sending from the [`CaptureLayer`] to [`CapturedLogEvents`] non-send resource.
2525
#[derive(Debug, Event)]
26-
pub struct LogEvent {
26+
struct LogEvent {
2727
message: String,
2828
}
2929

3030
/// This non-send resource temporarily stores [`LogEvent`]s before they are
3131
/// written to [`Events<LogEvent>`] by [`transfer_log_events`].
3232
#[derive(Deref, DerefMut)]
33-
pub struct CapturedLogEvents(mpsc::Receiver<LogEvent>);
33+
struct CapturedLogEvents(mpsc::Receiver<LogEvent>);
3434

3535
/// Transfers information from the `LogEvents` resource to [`Events<LogEvent>`](LogEvent).
36-
pub fn transfer_log_events(
36+
fn transfer_log_events(
3737
receiver: NonSend<CapturedLogEvents>,
3838
mut log_events: EventWriter<LogEvent>,
3939
) {
@@ -43,7 +43,7 @@ pub fn transfer_log_events(
4343

4444
/// This is the [`Layer`] that we will use to capture log events and then send them to Bevy's
4545
/// ECS via it's [`mpsc::Sender`].
46-
pub struct CaptureLayer {
46+
struct CaptureLayer {
4747
sender: mpsc::Sender<LogEvent>,
4848
}
4949
impl<S: Subscriber> Layer<S> for CaptureLayer {
@@ -77,8 +77,8 @@ impl tracing::field::Visit for CaptureLayerVisitor<'_> {
7777
}
7878
}
7979
}
80-
/// Update Subscriber
81-
pub fn update_subscriber(app: &mut App, subscriber: BoxedSubscriber) -> BoxedSubscriber {
80+
81+
fn update_subscriber(app: &mut App, subscriber: BoxedSubscriber) -> BoxedSubscriber {
8282
let (sender, receiver) = mpsc::channel();
8383

8484
let layer = CaptureLayer { sender };

0 commit comments

Comments
 (0)