Fix failures of typos and check-cfg (#12293)

# Objective

- CI is green

## Solution

- Fix typos (#12045)
- Correctly declare features (#12100)
This commit is contained in:
François 2024-03-04 08:48:09 +01:00 committed by GitHub
parent 34a02d957d
commit b1a5aabce9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 10 additions and 5 deletions

View file

@ -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",

View file

@ -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
@ -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 = [

View file

@ -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,

View file

@ -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
@ -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) {
@ -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>();