Skip to content

Commit 732c9b9

Browse files
committed
Extract module profiler
1 parent e6df1bb commit 732c9b9

File tree

5 files changed

+6
-10
lines changed

5 files changed

+6
-10
lines changed

gdnative-core/src/export/mod.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,6 @@ pub(crate) mod class_registry;
1919
pub(crate) mod emplace;
2020
pub(crate) mod type_tag;
2121

22-
pub use class::*;
23-
pub use method::*;
24-
pub use property::*;
25-
26-
pub mod profiler;
2722
pub mod user_data;
2823

2924
pub use crate::godot_wrap_method;

gdnative-core/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ pub mod export;
4848
pub mod init;
4949
pub mod log;
5050
pub mod object;
51+
pub mod profiler;
5152

5253
/// Internal low-level API for use by macros and generated bindings. Not a part of the public API.
5354
#[doc(hidden)]

gdnative-core/src/export/profiler.rs renamed to gdnative-core/src/profiler.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ where
167167
///
168168
/// ```rust
169169
/// # fn main() {
170-
/// use gdnative::export::profiler::{profile, profile_sig};
170+
/// use gdnative::profiler::{profile, profile_sig};
171171
///
172172
/// let answer = profile(profile_sig!("foo"), || 42);
173173
/// assert_eq!(answer, 42);
@@ -176,7 +176,7 @@ where
176176
#[macro_export]
177177
macro_rules! _profile_sig {
178178
($tag:expr) => {
179-
$crate::export::profiler::Signature::new(file!(), line!(), $tag)
179+
$crate::profiler::Signature::new(file!(), line!(), $tag)
180180
};
181181
}
182182

gdnative-derive/src/profiled.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ pub(crate) fn derive_profiled(
111111

112112
let stmts = std::mem::take(&mut item_fn.block.stmts);
113113
item_fn.block = Box::new(parse_quote!({
114-
::gdnative::export::profiler::profile(
115-
::gdnative::export::profiler::profile_sig!(#tag), move || {
114+
::gdnative::profiler::profile(
115+
::gdnative::profiler::profile_sig!(#tag), move || {
116116
#(#stmts)*
117117
})
118118
}));

gdnative/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
// Items, which are #[doc(hidden)] in their original crate and re-exported with a wildcard, lose
5959
// their hidden status. Re-exporting them manually and hiding the wildcard solves this.
6060
#[doc(inline)]
61-
pub use gdnative_core::{core_types, export, init, log, object};
61+
pub use gdnative_core::{core_types, export, init, log, object, profiler};
6262

6363
/// Collection of declarative `godot_*` macros, mostly for GDNative registration and output.
6464
pub mod macros {

0 commit comments

Comments
 (0)