Skip to content

Commit b77af9b

Browse files
committed
Move save, load etc.: godot::global -> godot::extras
1 parent 4725555 commit b77af9b

File tree

7 files changed

+10
-12
lines changed

7 files changed

+10
-12
lines changed

godot-core/src/engine/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,13 @@ pub use crate::extras::GFile;
4747
pub use crate::extras::IoError;
4848

4949
#[deprecated = "`save` has been moved to `godot::global`."]
50-
pub use crate::global::save;
50+
pub use crate::extras::save;
5151

5252
#[deprecated = "`try_save` has been moved to `godot::global`."]
53-
pub use crate::global::try_save;
53+
pub use crate::extras::try_save;
5454

5555
#[deprecated = "`load` has been moved to `godot::global`."]
56-
pub use crate::global::load;
56+
pub use crate::extras::load;
5757

5858
#[deprecated = "`try_load` has been moved to `godot::global`."]
59-
pub use crate::global::try_load;
59+
pub use crate::extras::try_load;

godot-core/src/extras/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@
77

88
mod gfile;
99
mod io_error;
10+
mod save_load;
1011
mod script_instance;
1112
mod translate;
1213

1314
pub use gfile::*;
1415
pub use io_error::*;
16+
pub use save_load::*;
1517
pub use script_instance::*;
1618
pub use translate::*;

godot-core/src/global/mod.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,13 @@
2323
//!
2424
2525
mod print;
26-
mod save_load;
2726

2827
pub use crate::{godot_error, godot_print, godot_print_rich, godot_script_error, godot_warn};
2928

3029
// Some enums are directly re-exported from crate::builtin.
3130
pub use crate::gen::central::global_enums::*;
3231
pub use crate::gen::utilities::*;
3332

34-
pub use save_load::*;
35-
3633
// This is needed for generated classes to find symbols, even those that have been moved to crate::builtin.
3734
#[allow(unused_imports)] // micromanaging imports for generated code is not fun
3835
pub(crate) use crate::builtin::{Corner, EulerOrder, Side};

godot-ffi/src/extras.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use crate::VariantType;
1313
// ----------------------------------------------------------------------------------------------------------------------------------------------
1414
// Static checks
1515

16-
// The impls only compile if those are different types -- ensures type safety through patch
16+
// The impls only compile if those are different types -- ensures type safety through patch.
1717
#[allow(dead_code)]
1818
trait Distinct {}
1919
impl Distinct for GDExtensionVariantPtr {}

godot/src/prelude.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,9 @@ pub use super::classes::{
1919
INode2D, INode3D, IObject, IPackedScene, IRefCounted, IResource, ISceneTree, Input, Node,
2020
Node2D, Node3D, Object, PackedScene, RefCounted, Resource, SceneTree,
2121
};
22-
pub use super::extras::{GFile, IoError};
22+
pub use super::extras::{load, save, try_load, try_save, GFile, IoError};
2323
pub use super::global::{
24-
godot_error, godot_print, godot_print_rich, godot_script_error, godot_warn, load, save,
25-
try_load, try_save,
24+
godot_error, godot_print, godot_print_rich, godot_script_error, godot_warn,
2625
};
2726

2827
pub use super::init::{gdextension, ExtensionLibrary, InitLevel};

itest/rust/src/engine_tests/save_load_test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
66
*/
77

8-
use godot::global::{load, save, try_load, try_save};
8+
use godot::extras::{load, save, try_load, try_save};
99
use godot::obj::NewGd;
1010
use godot::register::GodotClass;
1111

0 commit comments

Comments
 (0)