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_input/serialize",
"bevy_time/serialize", "bevy_time/serialize",
"bevy_window/serialize", "bevy_window/serialize",
"bevy_winit?/serialize",
"bevy_transform/serialize", "bevy_transform/serialize",
"bevy_math/serialize", "bevy_math/serialize",
"bevy_scene?/serialize", "bevy_scene?/serialize",

View File

@ -13,6 +13,7 @@ trace = []
wayland = ["winit/wayland", "winit/wayland-csd-adwaita"] wayland = ["winit/wayland", "winit/wayland-csd-adwaita"]
x11 = ["winit/x11"] x11 = ["winit/x11"]
accesskit_unix = ["accesskit_winit/accesskit_unix", "accesskit_winit/async-io"] accesskit_unix = ["accesskit_winit/accesskit_unix", "accesskit_winit/async-io"]
serialize = ["serde"]
[dependencies] [dependencies]
# bevy # bevy
@ -36,6 +37,7 @@ accesskit_winit = { version = "0.17", default-features = false, features = [
] } ] }
approx = { version = "0.5", default-features = false } approx = { version = "0.5", default-features = false }
raw-window-handle = "0.6" raw-window-handle = "0.6"
serde = { version = "1.0", features = ["derive"], optional = true }
[target.'cfg(target_os = "android")'.dependencies] [target.'cfg(target_os = "android")'.dependencies]
winit = { version = "0.29", default-features = false, features = [ winit = { version = "0.29", default-features = false, features = [

View File

@ -9,6 +9,8 @@ use bevy_input::{
touchpad::{TouchpadMagnify, TouchpadRotate}, touchpad::{TouchpadMagnify, TouchpadRotate},
}; };
use bevy_reflect::Reflect; use bevy_reflect::Reflect;
#[cfg(feature = "serialize")]
use bevy_reflect::{ReflectDeserialize, ReflectSerialize};
use bevy_window::{ use bevy_window::{
ApplicationLifetime, CursorEntered, CursorLeft, CursorMoved, FileDragAndDrop, Ime, ApplicationLifetime, CursorEntered, CursorLeft, CursorMoved, FileDragAndDrop, Ime,
ReceivedCharacter, RequestRedraw, WindowBackendScaleFactorChanged, WindowCloseRequested, 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). /// Transfers information from the [`LogEvents`] resource to [`Events<LogEvent>`](LogEvent).
fn transfer_log_events( fn transfer_log_events(
reciever: NonSend<CapturedLogEvents>, receiver: NonSend<CapturedLogEvents>,
mut log_events: EventWriter<LogEvent>, mut log_events: EventWriter<LogEvent>,
) { ) {
// Make sure to use `try_iter()` and not `iter()` to prevent blocking. // 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 /// 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>); struct CaptureLayerVisitor<'a>(&'a mut Option<String>);
impl tracing::field::Visit for CaptureLayerVisitor<'_> { impl tracing::field::Visit for CaptureLayerVisitor<'_> {
fn record_debug(&mut self, field: &tracing::field::Field, value: &dyn std::fmt::Debug) { 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 { fn update_subscriber(app: &mut App, subscriber: BoxedSubscriber) -> BoxedSubscriber {
let (sender, reciever) = mpsc::channel(); let (sender, receiver) = mpsc::channel();
let layer = CaptureLayer { sender }; let layer = CaptureLayer { sender };
let resource = CapturedLogEvents(reciever); let resource = CapturedLogEvents(receiver);
app.insert_non_send_resource(resource); app.insert_non_send_resource(resource);
app.add_event::<LogEvent>(); app.add_event::<LogEvent>();