Skip to content

Commit 729c4a4

Browse files
authored
fix up the build on nightly compilers (#135)
1 parent 89bcabf commit 729c4a4

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

examples/filters_from_code.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ Specify logging filters in code instead of using an environment variable.
66
extern crate log;
77
extern crate env_logger;
88

9-
use env_logger::Env;
10-
119
fn main() {
1210
env_logger::builder()
1311
.filter_level(log::LevelFilter::Trace)

src/fmt/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ pub(crate) struct Builder {
117117
pub default_format_timestamp_nanos: bool,
118118
pub default_format_module_path: bool,
119119
pub default_format_level: bool,
120+
#[allow(unknown_lints, bare_trait_objects)]
120121
pub custom_format: Option<Box<Fn(&mut Formatter, &Record) -> io::Result<()> + Sync + Send>>,
121122
built: bool,
122123
}
@@ -140,6 +141,7 @@ impl Builder {
140141
/// If the `custom_format` is `Some`, then any `default_format` switches are ignored.
141142
/// If the `custom_format` is `None`, then a default format is returned.
142143
/// Any `default_format` switches set to `false` won't be written by the format.
144+
#[allow(unknown_lints, bare_trait_objects)]
143145
pub fn build(&mut self) -> Box<Fn(&mut Formatter, &Record) -> io::Result<()> + Sync + Send> {
144146
assert!(!self.built, "attempt to re-use consumed builder");
145147

@@ -353,4 +355,4 @@ mod tests {
353355

354356
assert_eq!("log message\n", written);
355357
}
356-
}
358+
}

src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,7 @@ struct Var<'a> {
322322
pub struct Logger {
323323
writer: Writer,
324324
filter: Filter,
325+
#[allow(unknown_lints, bare_trait_objects)]
325326
format: Box<Fn(&mut Formatter, &Record) -> io::Result<()> + Sync + Send>,
326327
}
327328

0 commit comments

Comments
 (0)