re-export Option to use in macros

This commit is contained in:
Ashley Mannix 2022-03-22 23:44:12 +10:00
parent 4342193c02
commit 3b243dd2b8
2 changed files with 8 additions and 2 deletions

View File

@ -1625,6 +1625,12 @@ pub fn __private_api_enabled(level: Level, target: &str) -> bool {
logger().enabled(&Metadata::builder().level(level).target(target).build())
}
// WARNING: this is not part of the crate's public API and is subject to change at any time
#[doc(hidden)]
pub mod __private_api {
pub use std::option::Option;
}
/// The statically resolved maximum log level.
///
/// See the crate level documentation for information on how to configure this.

View File

@ -37,7 +37,7 @@ macro_rules! log {
__log_format_args!($($arg)+),
lvl,
&($target, __log_module_path!(), __log_file!(), __log_line!()),
std::option::Option::Some(&[$((__log_key!($key), &$value)),+])
$crate::__private_api::Option::Some(&[$((__log_key!($key), &$value)),+])
);
}
});
@ -50,7 +50,7 @@ macro_rules! log {
__log_format_args!($($arg)+),
lvl,
&($target, __log_module_path!(), __log_file!(), __log_line!()),
std::option::Option::None,
$crate::__private_api::Option::None,
);
}
});