Skip to content

Commit

Permalink
refactor: fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
BD103 committed Apr 23, 2024
1 parent a99d670 commit fa7f9ed
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 7 deletions.
5 changes: 4 additions & 1 deletion crates/bevy_app/src/plugin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,10 @@ impl Plugin for PlaceholderPlugin {
/// It is used for dynamically loading plugins.
///
/// See `bevy_dynamic_plugin/src/loader.rs#dynamically_load_plugin`.
#[deprecated(since = "0.14.0", note = "The current dynamic plugin system is unsound and will be removed in 0.15.")]
#[deprecated(
since = "0.14.0",
note = "The current dynamic plugin system is unsound and will be removed in 0.15."
)]
pub type CreatePlugin = unsafe fn() -> *mut dyn Plugin;

/// Types that represent a set of [`Plugin`]s.
Expand Down
5 changes: 4 additions & 1 deletion crates/bevy_derive/src/app_plugin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ use proc_macro::TokenStream;
use quote::quote;
use syn::{parse_macro_input, DeriveInput};

#[deprecated(since = "0.14.0", note = "The current dynamic plugin system is unsound and will be removed in 0.15.")]
#[deprecated(
since = "0.14.0",
note = "The current dynamic plugin system is unsound and will be removed in 0.15."
)]
pub fn derive_dynamic_plugin(input: TokenStream) -> TokenStream {
let ast = parse_macro_input!(input as DeriveInput);
let struct_name = &ast.ident;
Expand Down
7 changes: 5 additions & 2 deletions crates/bevy_derive/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,13 @@ use proc_macro::TokenStream;
use quote::format_ident;

/// Generates a dynamic plugin entry point function for the given `Plugin` type.
///
///
/// This is deprecated since 0.14. The current dynamic plugin system is unsound and will be removed in 0.15.
#[proc_macro_derive(DynamicPlugin)]
#[deprecated(since = "0.14.0", note = "The current dynamic plugin system is unsound and will be removed in 0.15.")]
#[deprecated(
since = "0.14.0",
note = "The current dynamic plugin system is unsound and will be removed in 0.15."
)]
pub fn derive_dynamic_plugin(input: TokenStream) -> TokenStream {
app_plugin::derive_dynamic_plugin(input)
}
Expand Down
15 changes: 12 additions & 3 deletions crates/bevy_dynamic_plugin/src/loader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ use bevy_app::{App, CreatePlugin, Plugin};

/// Errors that can occur when loading a dynamic plugin
#[derive(Debug, Error)]
#[deprecated(since = "0.14.0", note = "The current dynamic plugin system is unsound and will be removed in 0.15.")]
#[deprecated(
since = "0.14.0",
note = "The current dynamic plugin system is unsound and will be removed in 0.15."
)]
pub enum DynamicPluginLoadError {
/// An error occurred when loading a dynamic library.
#[error("cannot load library for dynamic plugin: {0}")]
Expand All @@ -32,7 +35,10 @@ pub enum DynamicPluginLoadError {
/// foreign code, initialization routines may be run (as well as termination routines when the
/// program exits). The caller of this function is responsible for ensuring these routines are
/// sound. For more information, please see the safety section of [`libloading::Library::new`].
#[deprecated(since = "0.14.0", note = "The current dynamic plugin system is unsound and will be removed in 0.15.")]
#[deprecated(
since = "0.14.0",
note = "The current dynamic plugin system is unsound and will be removed in 0.15."
)]
pub unsafe fn dynamically_load_plugin<P: AsRef<OsStr>>(
path: P,
) -> Result<(Library, Box<dyn Plugin>), DynamicPluginLoadError> {
Expand All @@ -54,7 +60,10 @@ pub unsafe fn dynamically_load_plugin<P: AsRef<OsStr>>(
}

/// An extension trait for [`App`] that allows loading dynamic plugins.
#[deprecated(since = "0.14.0", note = "The current dynamic plugin system is unsound and will be removed in 0.15.")]
#[deprecated(
since = "0.14.0",
note = "The current dynamic plugin system is unsound and will be removed in 0.15."
)]
pub trait DynamicPluginExt {
/// Dynamically links a plugin at the given path, registering the plugin.
///
Expand Down

0 comments on commit fa7f9ed

Please sign in to comment.