Drakulix / simplelog.rs

Simple Logging Facility for Rust
https://docs.rs/simplelog/
Apache License 2.0
439 stars 73 forks source link

Compilation issues when test feature enabled #46

Closed jgoerzen closed 5 years ago

jgoerzen commented 5 years ago
error[E0308]: mismatched types
   --> /home/jgoerzen/.cargo/registry/src/github.com-1ecc6299db9ec823/simplelog-0.7.1/src/loggers/testlog.rs:106:12
    |
106 |     if let Some(time) = config.time {
    |            ^^^^^^^^^^   ----------- this match expression has type `log::LevelFilter`
    |            |
    |            expected enum `log::LevelFilter`, found enum `std::option::Option`
    |
    = note: expected type `log::LevelFilter`
               found type `std::option::Option<_>`

error[E0308]: mismatched types
   --> /home/jgoerzen/.cargo/registry/src/github.com-1ecc6299db9ec823/simplelog-0.7.1/src/loggers/testlog.rs:112:12
    |
112 |     if let Some(level) = config.level {
    |            ^^^^^^^^^^^   ------------ this match expression has type `log::LevelFilter`
    |            |
    |            expected enum `log::LevelFilter`, found enum `std::option::Option`
    |
    = note: expected type `log::LevelFilter`
               found type `std::option::Option<_>`

error[E0308]: mismatched types
   --> /home/jgoerzen/.cargo/registry/src/github.com-1ecc6299db9ec823/simplelog-0.7.1/src/loggers/testlog.rs:118:12
    |
118 |     if let Some(thread) = config.thread {
    |            ^^^^^^^^^^^^   ------------- this match expression has type `log::LevelFilter`
    |            |
    |            expected enum `log::LevelFilter`, found enum `std::option::Option`
    |
    = note: expected type `log::LevelFilter`
               found type `std::option::Option<_>`

error[E0308]: mismatched types
   --> /home/jgoerzen/.cargo/registry/src/github.com-1ecc6299db9ec823/simplelog-0.7.1/src/loggers/testlog.rs:124:12
    |
124 |     if let Some(target) = config.target {
    |            ^^^^^^^^^^^^   ------------- this match expression has type `log::LevelFilter`
    |            |
    |            expected enum `log::LevelFilter`, found enum `std::option::Option`
    |
    = note: expected type `log::LevelFilter`
               found type `std::option::Option<_>`

error[E0308]: mismatched types
   --> /home/jgoerzen/.cargo/registry/src/github.com-1ecc6299db9ec823/simplelog-0.7.1/src/loggers/testlog.rs:130:12
    |
130 |     if let Some(location) = config.location {
    |            ^^^^^^^^^^^^^^   --------------- this match expression has type `log::LevelFilter`
    |            |
    |            expected enum `log::LevelFilter`, found enum `std::option::Option`
    |
    = note: expected type `log::LevelFilter`
               found type `std::option::Option<_>`

error[E0599]: no method named `unwrap_or` found for type `std::borrow::Cow<'static, str>` in the current scope
   --> /home/jgoerzen/.cargo/registry/src/github.com-1ecc6299db9ec823/simplelog-0.7.1/src/loggers/testlog.rs:144:44
    |
144 |         cur_time.format(config.time_format.unwrap_or("%H:%M:%S"))
    |                                            ^^^^^^^^^

error: aborting due to 6 previous errors

Builds fine without test feature... but I need that feature

Drakulix commented 5 years ago

Fix released with 0.7.3 on crates.io