Skip to content

Commit 3734725

Browse files
committed
Extract prelude to its own file
1 parent c907dd9 commit 3734725

File tree

2 files changed

+37
-30
lines changed

2 files changed

+37
-30
lines changed

godot/src/lib.rs

Lines changed: 2 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,8 @@ pub mod register {
205205
pub use godot_macros::{godot_api, Export, FromGodot, GodotClass, GodotConvert, ToGodot, Var};
206206
}
207207

208-
#[deprecated = "Renamed to `register`."]
209208
/// Renamed to [`register`] module.
209+
#[deprecated = "Renamed to `register`."]
210210
pub mod bind {
211211
pub use super::register::*;
212212
}
@@ -221,32 +221,4 @@ pub mod test {
221221
pub use godot_core::private;
222222

223223
/// Often-imported symbols.
224-
pub mod prelude {
225-
pub use super::register::property::{Export, TypeStringHint, Var};
226-
pub use super::register::{
227-
godot_api, Export, FromGodot, GodotClass, GodotConvert, ToGodot, Var,
228-
};
229-
230-
pub use super::builtin::math::FloatExt as _;
231-
pub use super::builtin::meta::{FromGodot, ToGodot};
232-
pub use super::builtin::*;
233-
pub use super::builtin::{array, dict, varray}; // Re-export macros.
234-
pub use super::engine::{
235-
load, try_load, utilities, AudioStreamPlayer, Camera2D, Camera3D, GFile,
236-
IAudioStreamPlayer, ICamera2D, ICamera3D, INode, INode2D, INode3D, IObject, IPackedScene,
237-
IRefCounted, IResource, ISceneTree, Input, Node, Node2D, Node3D, Object, PackedScene,
238-
PackedSceneExt, RefCounted, Resource, SceneTree,
239-
};
240-
pub use super::init::{gdextension, ExtensionLibrary, InitLevel};
241-
pub use super::log::*;
242-
pub use super::obj::{Base, Gd, GdMut, GdRef, GodotClass, Inherits, InstanceId, OnReady};
243-
244-
// Make trait methods available
245-
pub use super::engine::NodeExt as _;
246-
pub use super::obj::EngineBitfield as _;
247-
pub use super::obj::EngineEnum as _;
248-
pub use super::obj::NewAlloc as _;
249-
pub use super::obj::NewGd as _;
250-
pub use super::obj::UserClass as _; // new_gd(), alloc_gd() -- TODO: remove (exposed functions are deprecated)
251-
pub use super::obj::WithBaseField as _; // to_gd()
252-
}
224+
pub mod prelude;

godot/src/prelude.rs

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/*
2+
* Copyright (c) godot-rust; Bromeon and contributors.
3+
* This Source Code Form is subject to the terms of the Mozilla Public
4+
* License, v. 2.0. If a copy of the MPL was not distributed with this
5+
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
6+
*/
7+
8+
pub use super::register::property::{Export, TypeStringHint, Var};
9+
10+
// Re-export macros.
11+
pub use super::register::{godot_api, Export, FromGodot, GodotClass, GodotConvert, ToGodot, Var};
12+
13+
pub use super::builtin::math::FloatExt as _;
14+
pub use super::builtin::meta::{FromGodot, ToGodot};
15+
pub use super::builtin::*;
16+
pub use super::builtin::{array, dict, varray};
17+
18+
pub use super::engine::{
19+
load, try_load, utilities, AudioStreamPlayer, Camera2D, Camera3D, GFile, IAudioStreamPlayer,
20+
ICamera2D, ICamera3D, INode, INode2D, INode3D, IObject, IPackedScene, IRefCounted, IResource,
21+
ISceneTree, Input, Node, Node2D, Node3D, Object, PackedScene, PackedSceneExt, RefCounted,
22+
Resource, SceneTree,
23+
};
24+
pub use super::init::{gdextension, ExtensionLibrary, InitLevel};
25+
pub use super::log::*;
26+
pub use super::obj::{Base, Gd, GdMut, GdRef, GodotClass, Inherits, InstanceId, OnReady};
27+
28+
// Make trait methods available.
29+
pub use super::engine::NodeExt as _;
30+
pub use super::obj::EngineBitfield as _;
31+
pub use super::obj::EngineEnum as _;
32+
pub use super::obj::NewAlloc as _;
33+
pub use super::obj::NewGd as _;
34+
pub use super::obj::UserClass as _; // TODO: remove (exposed functions are deprecated)
35+
pub use super::obj::WithBaseField as _; // base(), base_mut(), to_gd()

0 commit comments

Comments
 (0)