Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix failures of typos and check-cfg #12293

Merged
merged 3 commits into from
Mar 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions crates/bevy_internal/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ serialize = [
"bevy_input/serialize",
"bevy_time/serialize",
"bevy_window/serialize",
"bevy_winit?/serialize",
"bevy_transform/serialize",
"bevy_math/serialize",
"bevy_scene?/serialize",
Expand Down
2 changes: 2 additions & 0 deletions crates/bevy_winit/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ trace = []
wayland = ["winit/wayland", "winit/wayland-csd-adwaita"]
x11 = ["winit/x11"]
accesskit_unix = ["accesskit_winit/accesskit_unix", "accesskit_winit/async-io"]
serialize = ["serde"]

[dependencies]
# bevy
Expand All @@ -36,6 +37,7 @@ accesskit_winit = { version = "0.17", default-features = false, features = [
] }
approx = { version = "0.5", default-features = false }
raw-window-handle = "0.6"
serde = { version = "1.0", features = ["derive"], optional = true }

[target.'cfg(target_os = "android")'.dependencies]
winit = { version = "0.29", default-features = false, features = [
Expand Down
2 changes: 2 additions & 0 deletions crates/bevy_winit/src/winit_event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ use bevy_input::{
touchpad::{TouchpadMagnify, TouchpadRotate},
};
use bevy_reflect::Reflect;
#[cfg(feature = "serialize")]
use bevy_reflect::{ReflectDeserialize, ReflectSerialize};
use bevy_window::{
ApplicationLifetime, CursorEntered, CursorLeft, CursorMoved, FileDragAndDrop, Ime,
ReceivedCharacter, RequestRedraw, WindowBackendScaleFactorChanged, WindowCloseRequested,
Expand Down
10 changes: 5 additions & 5 deletions examples/app/log_layers_ecs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ struct CapturedLogEvents(mpsc::Receiver<LogEvent>);

/// Transfers information from the [`LogEvents`] resource to [`Events<LogEvent>`](LogEvent).
fn transfer_log_events(
reciever: NonSend<CapturedLogEvents>,
receiver: NonSend<CapturedLogEvents>,
mut log_events: EventWriter<LogEvent>,
) {
// Make sure to use `try_iter()` and not `iter()` to prevent blocking.
log_events.send_batch(reciever.try_iter());
log_events.send_batch(receiver.try_iter());
}

/// This is the [`Layer`] that we will use to capture log events and then send them to Bevy's
Expand Down Expand Up @@ -67,7 +67,7 @@ impl<S: Subscriber> Layer<S> for CaptureLayer {
}
}

/// A [`Visit`](tracing::field::Visit)or that records log messages that are transfered to [`CaptureLayer`].
/// A [`Visit`](tracing::field::Visit)or that records log messages that are transferred to [`CaptureLayer`].
struct CaptureLayerVisitor<'a>(&'a mut Option<String>);
impl tracing::field::Visit for CaptureLayerVisitor<'_> {
fn record_debug(&mut self, field: &tracing::field::Field, value: &dyn std::fmt::Debug) {
Expand All @@ -78,10 +78,10 @@ impl tracing::field::Visit for CaptureLayerVisitor<'_> {
}
}
fn update_subscriber(app: &mut App, subscriber: BoxedSubscriber) -> BoxedSubscriber {
let (sender, reciever) = mpsc::channel();
let (sender, receiver) = mpsc::channel();

let layer = CaptureLayer { sender };
let resource = CapturedLogEvents(reciever);
let resource = CapturedLogEvents(receiver);

app.insert_non_send_resource(resource);
app.add_event::<LogEvent>();
Expand Down