From aba8743714f19ea22430c47c0c07ef84d1b89428 Mon Sep 17 00:00:00 2001 From: Dmitry Stepanov Date: Wed, 8 Jul 2026 19:59:24 +0300 Subject: [PATCH] fixed compilation errors for doc tests --- fyrox-impl/src/engine/task.rs | 4 ++-- fyrox-impl/src/plugin/mod.rs | 8 ++++---- fyrox-impl/src/script/mod.rs | 8 ++++---- fyrox-resource/src/builtin.rs | 2 +- fyrox-scripts/src/lib.rs | 2 +- fyrox-ui/src/build.rs | 2 +- fyrox-ui/src/control.rs | 6 +++--- fyrox-ui/src/inspector/editors/mod.rs | 4 ++-- fyrox-ui/src/inspector/mod.rs | 4 ++-- fyrox-ui/src/node/mod.rs | 2 +- fyrox-ui/src/text_box.rs | 4 +++- 11 files changed, 24 insertions(+), 22 deletions(-) diff --git a/fyrox-impl/src/engine/task.rs b/fyrox-impl/src/engine/task.rs index 82ac37b08..80c5b11a2 100644 --- a/fyrox-impl/src/engine/task.rs +++ b/fyrox-impl/src/engine/task.rs @@ -103,7 +103,7 @@ impl TaskPoolHandler { /// # use fyrox_impl::core::reflect::prelude::*; /// # use std::{fs::File, io::Read}; /// - /// #[derive(Visit, Reflect, Debug)] + /// #[derive(Visit, Reflect, PartialEq, Debug)] /// #[reflect(non_cloneable, type_uuid = "a7ba17c1-6104-4938-9ba7-ba479acf716a")] /// struct MyGame { /// data: Option>, @@ -181,7 +181,7 @@ impl TaskPoolHandler { /// # /// # use fyrox_impl::plugin::error::GameResult; /// # - /// #[derive(Reflect, Visit, Default, Debug, Clone)] + /// #[derive(Reflect, Visit, PartialEq, Default, Debug, Clone)] /// #[reflect(type_uuid = "f5ded79e-6101-4e23-b20d-48cbdb25d87a")] /// struct MyScript; /// diff --git a/fyrox-impl/src/plugin/mod.rs b/fyrox-impl/src/plugin/mod.rs index e8beba9c1..3098ebaf3 100644 --- a/fyrox-impl/src/plugin/mod.rs +++ b/fyrox-impl/src/plugin/mod.rs @@ -244,7 +244,7 @@ impl<'a, 'b> PluginContext<'a, 'b> { /// # }; /// # use std::str::FromStr; /// - /// #[derive(Default, Visit, Reflect, Debug)] + /// #[derive(Default, Visit, PartialEq, Reflect, Debug)] /// #[reflect(non_cloneable, type_uuid = "ce9c7ff9-f490-4274-89c9-0b53b9f80532")] /// struct MyGame {} /// @@ -315,7 +315,7 @@ impl<'a, 'b> PluginContext<'a, 'b> { /// # }; /// # use std::str::FromStr; /// # - /// #[derive(Default, Visit, Reflect, Debug)] + /// #[derive(Default, Visit, PartialEq, Reflect, Debug)] /// #[reflect(non_cloneable, type_uuid = "65b2da10-3926-48e4-93b4-01193cdc11ca")] /// struct MyGame {} /// @@ -493,7 +493,7 @@ impl dyn Plugin { /// # }; /// # use std::str::FromStr; /// -/// #[derive(Default, Visit, Reflect, Debug)] +/// #[derive(Default, Visit, PartialEq, Reflect, Debug)] /// #[reflect(non_cloneable, type_uuid = "342b2ef7-210d-465f-bcae-f59aa3a96420")] /// struct MyPlugin {} /// @@ -535,7 +535,7 @@ impl dyn Plugin { /// # scene::{node::Node, Scene}, /// # }; /// # use std::str::FromStr; -/// #[derive(Default, Visit, Reflect, Debug)] +/// #[derive(Default, Visit, PartialEq, Reflect, Debug)] /// #[reflect(non_cloneable, type_uuid = "94801cca-3f50-4bef-9b6f-ee2edd9dcb2b")] /// struct MyPlugin { /// scene: Handle, diff --git a/fyrox-impl/src/script/mod.rs b/fyrox-impl/src/script/mod.rs index 196f8c603..892c5df56 100644 --- a/fyrox-impl/src/script/mod.rs +++ b/fyrox-impl/src/script/mod.rs @@ -228,7 +228,7 @@ pub trait BaseScript: Visit + Reflect + Send + Debug + 'static { /// core::uuid::uuid, /// }; /// - /// #[derive(Reflect, Visit, Debug, Clone)] + /// #[derive(Reflect, Visit, PartialEq, Debug, Clone)] /// // Use https://www.uuidgenerator.net/ to generate new UUID or an extension for your IDE. /// #[reflect(type_uuid = "4cfbe65e-a2c1-474f-b123-57516d80b1f8")] /// struct MyScript { } @@ -335,7 +335,7 @@ pub struct ScriptContext<'a, 'b, 'c> { /// # script::{ScriptContext, ScriptTrait}, /// # }; /// # - /// #[derive(Visit, Reflect, Default, Debug)] + /// #[derive(Visit, Reflect, PartialEq, Default, Debug)] /// #[reflect(non_cloneable, type_uuid = "bf06a1f4-5e76-4560-a260-e64187a9484b")] /// struct Game { /// player_name: String, @@ -343,7 +343,7 @@ pub struct ScriptContext<'a, 'b, 'c> { /// /// impl Plugin for Game {} /// - /// #[derive(Visit, Reflect, Clone, Default, Debug)] + /// #[derive(Visit, Reflect, PartialEq, Clone, Default, Debug)] /// #[reflect(type_uuid = "f732654e-5e3c-4b52-9a3d-44c0cfb14e18")] /// struct MyScript {} /// @@ -660,7 +660,7 @@ pub trait ScriptTrait: BaseScript { /// /// struct Message; /// - /// #[derive(Reflect, Visit, Debug, Clone)] + /// #[derive(Reflect, Visit, PartialEq, Debug, Clone)] /// #[reflect(type_uuid = "2649187c-46c2-485f-bf62-c9d3aef0c432")] /// struct MyScript {} /// diff --git a/fyrox-resource/src/builtin.rs b/fyrox-resource/src/builtin.rs index d851e57d2..59d9564b3 100644 --- a/fyrox-resource/src/builtin.rs +++ b/fyrox-resource/src/builtin.rs @@ -96,7 +96,7 @@ pub struct UntypedBuiltInResource { /// }; /// use std::{error::Error, path::Path}; /// -/// #[derive(Default, Debug, Clone, Visit, Reflect)] +/// #[derive(Default, Debug, PartialEq, Clone, Visit, Reflect)] /// #[reflect(type_uuid = "00d036bb-fbed-47f7-94e3-b3fce93dee17")] /// struct MyResource { /// some_data: String, diff --git a/fyrox-scripts/src/lib.rs b/fyrox-scripts/src/lib.rs index 1bd74fcad..655fc54a8 100644 --- a/fyrox-scripts/src/lib.rs +++ b/fyrox-scripts/src/lib.rs @@ -35,7 +35,7 @@ pub mod camera; /// # scene::Scene, /// # }; /// # -/// # #[derive(Visit, Reflect, Debug)] +/// # #[derive(Visit, Reflect, PartialEq, Debug)] /// # #[reflect(non_cloneable, type_uuid = "38a3d4cf-65e1-4e86-a730-365804c51cff")] /// # struct Game; /// # diff --git a/fyrox-ui/src/build.rs b/fyrox-ui/src/build.rs index bffa00051..dba5ec631 100644 --- a/fyrox-ui/src/build.rs +++ b/fyrox-ui/src/build.rs @@ -57,7 +57,7 @@ use std::{ /// # }; /// # /// # -/// #[derive(Clone, Visit, Reflect, Debug)] +/// #[derive(Clone, Visit, Reflect, PartialEq, Debug)] /// #[reflect(derived_type = "UiNode", type_uuid = "a93ec1b5-e7c8-4919-ac19-687d8c99f6bd")] /// struct MyWidget { /// widget: Widget, diff --git a/fyrox-ui/src/control.rs b/fyrox-ui/src/control.rs index 1a19b782e..8c7c97911 100644 --- a/fyrox-ui/src/control.rs +++ b/fyrox-ui/src/control.rs @@ -195,7 +195,7 @@ pub trait Control: BaseControl + Deref + DerefMut + Reflect + V /// # /// # use fyrox_graph::SceneGraph; /// # - /// #[derive(Clone, Visit, Reflect, Debug)] + /// #[derive(Clone, Visit, Reflect, PartialEq, Debug)] /// #[reflect(derived_type = "UiNode", type_uuid = "a93ec1b5-e7c8-4919-ac19-687d8c99f6bd")] /// struct MyWidget { /// widget: Widget, @@ -265,7 +265,7 @@ pub trait Control: BaseControl + Deref + DerefMut + Reflect + V /// # }; /// # /// # - /// #[derive(Clone, Visit, Reflect, Debug)] + /// #[derive(Clone, Visit, PartialEq, Reflect, Debug)] /// #[reflect(derived_type = "UiNode", type_uuid = "a93ec1b5-e7c8-4919-ac19-687d8c99f6bd")] /// struct MyWidget { /// widget: Widget, @@ -322,7 +322,7 @@ pub trait Control: BaseControl + Deref + DerefMut + Reflect + V /// # }; /// # /// # - /// #[derive(Clone, Visit, Reflect, Debug)] + /// #[derive(Clone, Visit, PartialEq, Reflect, Debug)] /// #[reflect(derived_type = "UiNode", type_uuid = "a93ec1b5-e7c8-4919-ac19-687d8c99f6bd")] /// struct MyWidget { /// widget: Widget, diff --git a/fyrox-ui/src/inspector/editors/mod.rs b/fyrox-ui/src/inspector/editors/mod.rs index d8d9ce222..b0cea6f48 100644 --- a/fyrox-ui/src/inspector/editors/mod.rs +++ b/fyrox-ui/src/inspector/editors/mod.rs @@ -215,7 +215,7 @@ pub struct PropertyEditorMessageContext<'a, 'b, 'c> { /// Optional untyped information about the broader application in which /// this property is being translated. This allows the created message to /// adapt to the situation if we can successfully cast the given - /// [InspectorEnvironment] into a specific type. + /// content of [InspectorEnvironmentContainer] into a specific type. pub environment: Option, /// When true, this indicates that an Inspector should generate strings from `format!("{:?}", field)`, for each field. /// Having this in the property editor build context indicates how any Inspectors that are update due to the created message @@ -241,7 +241,7 @@ pub struct PropertyEditorTranslationContext<'b, 'c> { /// Optional untyped information about the broader application in which /// this property is being translated. This allows the translation to /// adapt to the situation if we can successfully cast the given - /// [InspectorEnvironment] into a specific type. + /// content of the [InspectorEnvironmentContainer] into a specific type. /// /// When the environment is not None, it is often a /// [fyroxed_base::inspector::EditorEnvironment](https://docs.rs/fyroxed_base/latest/fyroxed_base/inspector/struct.EditorEnvironment.html) diff --git a/fyrox-ui/src/inspector/mod.rs b/fyrox-ui/src/inspector/mod.rs index 7d189b4ca..d0ca9b7ea 100644 --- a/fyrox-ui/src/inspector/mod.rs +++ b/fyrox-ui/src/inspector/mod.rs @@ -461,7 +461,7 @@ impl Deref for InspectorEnvironmentContainer { /// # use strum_macros::{AsRefStr, EnumString, VariantNames}; /// # use fyrox_ui::inspector::{Inspector, InspectorContextArgs}; /// -/// #[derive(Reflect, Debug, Clone)] +/// #[derive(Reflect, Debug, PartialEq, Clone)] /// #[reflect(type_uuid = "391b9424-8fe2-4525-a98e-3c930487fcf1")] /// struct MyObject { /// foo: String, @@ -471,7 +471,7 @@ impl Deref for InspectorEnvironmentContainer { /// /// // Enumeration requires a bit more traits to be implemented. It must provide a way to turn /// // enum into a string. -/// #[derive(Reflect, Debug, Clone, AsRefStr, EnumString, VariantNames)] +/// #[derive(Reflect, Debug, Clone, PartialEq, AsRefStr, EnumString, VariantNames)] /// #[reflect(type_uuid = "a93ec1b5-e7c8-4919-ac19-687d8c99f6bd")] /// enum MyEnum { /// SomeVariant, diff --git a/fyrox-ui/src/node/mod.rs b/fyrox-ui/src/node/mod.rs index 3f78ba06d..e0c5b4af7 100644 --- a/fyrox-ui/src/node/mod.rs +++ b/fyrox-ui/src/node/mod.rs @@ -169,7 +169,7 @@ impl UiNode { /// # }; /// # /// # - /// #[derive(Clone, Visit, Reflect, Debug)] + /// #[derive(Clone, Visit, PartialEq, Reflect, Debug)] /// #[reflect(derived_type = "UiNode", type_uuid = "a93ec1b5-e7c8-4919-ac19-687d8c99f6bd")] /// struct MyWidget { /// widget: Widget, diff --git a/fyrox-ui/src/text_box.rs b/fyrox-ui/src/text_box.rs index 8d9f89bf0..dabb38c7e 100644 --- a/fyrox-ui/src/text_box.rs +++ b/fyrox-ui/src/text_box.rs @@ -400,10 +400,12 @@ impl Deref for TextBoxFilter { /// # }; /// # use std::sync::Arc; /// # use fyrox_core::parking_lot::Mutex; +/// # use fyrox_ui::text_box::TextBoxFilter; +/// /// fn create_text_box(ui: &mut UserInterface) -> Handle { /// TextBoxBuilder::new(WidgetBuilder::new()) /// // Specify a filter that will pass only digits. -/// .with_filter(Arc::new(Mutex::new(|c: char| c.is_ascii_digit()))) +/// .with_filter(TextBoxFilter(Arc::new(Mutex::new(|c: char| c.is_ascii_digit())))) /// .build(&mut ui.build_ctx()) /// } /// ```