Skip to content

Commit 2f50d62

Browse files
committed
Extract profiler
1 parent ffc1336 commit 2f50d62

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

gdnative-core/src/export/mod.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@
99
//! If you are looking for how to manage Godot core types or classes (objects), check
1010
//! out the [`core_types`][crate::core_types] and [`object`][crate::object] modules, respectively.
1111
12+
pub use class::*;
13+
pub use export::*;
14+
pub use method::*;
15+
pub use property::*;
16+
1217
mod class;
1318
mod export;
1419
#[allow(clippy::module_inception)] // same name as this module; TODO rename or spill out
@@ -20,10 +25,4 @@ pub(crate) mod class_registry;
2025
pub(crate) mod emplace;
2126
pub(crate) mod type_tag;
2227

23-
pub use class::*;
24-
pub use export::*;
25-
pub use method::*;
26-
pub use property::*;
27-
28-
pub mod profiler;
2928
pub mod user_data;

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, profiler, log, object};
6262

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

0 commit comments

Comments
 (0)