Skip to content

Commit 22ab1d9

Browse files
committed
Merge pull request #5 from drbawb/feature/fix-format-args
Remove closure from format_args! call
2 parents 68d87ee + 69e9e2e commit 22ab1d9

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ impl Drop for DefaultLogger {
273273
/// It is not recommended to call this function directly, rather it should be
274274
/// invoked through the logging family of macros.
275275
#[doc(hidden)]
276-
pub fn log(level: u32, loc: &'static LogLocation, args: &fmt::Arguments) {
276+
pub fn log(level: u32, loc: &'static LogLocation, args: fmt::Arguments) {
277277
// Test the literal string from args against the current filter, if there
278278
// is one.
279279
match unsafe { FILTER.as_ref() } {
@@ -326,7 +326,7 @@ pub struct LogRecord<'a> {
326326
pub level: LogLevel,
327327

328328
/// The arguments from the log line.
329-
pub args: &'a fmt::Arguments<'a>,
329+
pub args: fmt::Arguments<'a>,
330330

331331
/// The file of where the LogRecord originated.
332332
pub file: &'a str,

src/macros.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ macro_rules! log {
6060
};
6161
let lvl = $lvl;
6262
if log_enabled!(lvl) {
63-
format_args!(|args| { ::log::log(lvl, &LOC, args) }, $($arg)+)
63+
::log::log(lvl, &LOC, format_args!($($arg)+));
6464
}
6565
})
6666
}

0 commit comments

Comments
 (0)