Skip to content

Commit 22f8474

Browse files
committed
Tweak privacy of internal structs and functions
1 parent a430ae3 commit 22f8474

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

src/lib.rs

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,8 @@ pub struct PixelsResource {
2929
pub window: Entity,
3030
}
3131

32-
// Internal configuration resource for use in `setup` system. Users should set values on
33-
// `PixelsPlugin` instead of inserting this resource directly. Ideally we just read the plugin
34-
// configuration directly within `setup` system, but this is not currently possible.
3532
#[derive(Resource)]
36-
pub struct PixelsOptions {
33+
struct PixelsOptions {
3734
width: u32,
3835
height: u32,
3936
}
@@ -76,7 +73,7 @@ impl PixelsPlugin {
7673
pub const RENDER_TIME: DiagnosticId =
7774
DiagnosticId::from_u128(1187582084072339577959028643519383692);
7875

79-
pub fn setup(
76+
fn setup(
8077
mut commands: Commands,
8178
mut diagnostics: ResMut<Diagnostics>,
8279
options: Res<PixelsOptions>,
@@ -111,7 +108,7 @@ impl PixelsPlugin {
111108
commands.insert_resource(PixelsResource { pixels, window });
112109
}
113110

114-
pub fn window_resize(
111+
fn window_resize(
115112
mut window_resized_events: EventReader<WindowResized>,
116113
mut resource: ResMut<PixelsResource>,
117114
windows: Query<&Window>,
@@ -125,7 +122,7 @@ impl PixelsPlugin {
125122
}
126123
}
127124

128-
pub fn window_change(
125+
fn window_change(
129126
mut window_backend_scale_factor_changed_events: EventReader<
130127
WindowBackendScaleFactorChanged,
131128
>,
@@ -148,7 +145,7 @@ impl PixelsPlugin {
148145
}
149146

150147
#[cfg(not(target_arch = "wasm32"))]
151-
pub fn render(resource: Res<PixelsResource>, mut diagnostics: ResMut<Diagnostics>) {
148+
fn render(resource: Res<PixelsResource>, mut diagnostics: ResMut<Diagnostics>) {
152149
let start = Instant::now();
153150

154151
resource.pixels.render().expect("failed to render pixels");
@@ -159,7 +156,7 @@ impl PixelsPlugin {
159156
}
160157

161158
#[cfg(target_arch = "wasm32")]
162-
pub fn render(resource: Res<PixelsResource>) {
159+
fn render(resource: Res<PixelsResource>) {
163160
resource.pixels.render().expect("failed to render pixels");
164161
}
165162
}

0 commit comments

Comments
 (0)