Skip to content

Commit

Permalink
Fix clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
roblabla committed Jun 3, 2019
1 parent ad680cd commit 5fe3a38
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 18 deletions.
2 changes: 2 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions clock/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
#[macro_use]
extern crate sunrise_libuser;
#[macro_use]
extern crate alloc;
#[macro_use]
extern crate log;

use sunrise_libuser::terminal::{Terminal, WindowSize};
Expand Down Expand Up @@ -157,7 +155,7 @@ fn main() {
year = (year & 0x0F) + ((year / 16) * 10);
}

let _ = info!("{:02}:{:02}:{:02} {} {:02} {} {}", hours, minutes, seconds, get_day_of_week(dayofweek), day, get_month(month), year);
info!("{:02}:{:02}:{:02} {} {:02} {} {}", hours, minutes, seconds, get_day_of_week(dayofweek), day, get_month(month), year);
let _ = write!(&mut logger, "\n{:02}:{:02}:{:02} {} {:02} {} {}", hours, minutes, seconds, get_day_of_week(dayofweek), day, get_month(month), year);
}
}
Expand Down
2 changes: 1 addition & 1 deletion libuser/src/ipc/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ impl WaitableManager {
Ok(false) => (),
Ok(true) => { waitables.remove(idx); },
Err(err) => {
let _ = error!("Error: {}", err);
error!("Error: {}", err);
waitables.remove(idx);
}
}
Expand Down
3 changes: 0 additions & 3 deletions libuser/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@ extern crate failure;
#[doc(hidden)]
pub extern crate log as __log;

#[macro_use]
extern crate lazy_static;

use swipc_gen::gen_ipc;

pub mod caps;
Expand Down
10 changes: 1 addition & 9 deletions libuser/src/log_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,14 @@
//! Redirects all logs to the kernel logger (output_debug_string syscall). No
//! filtering is done, so everything will be sent.
use spin::Mutex;
use arrayvec::ArrayString;
use log::{self, Log, LevelFilter, Metadata, Record};
use crate::syscalls::output_debug_string;
use core::fmt::{self, Write};

/// Log implementation structure.
///
/// See module documentation for more information.
struct Logger;

struct LogItem<'a> {
cur_level: u64,
cur_target: &'a str,
}

impl Log for Logger {
fn enabled(&self, _metadata: &Metadata<'_>) -> bool {
true
Expand All @@ -32,7 +24,7 @@ impl Log for Logger {
log::Level::Debug => 70,
log::Level::Trace => 90,
};
output_debug_string(&*format!("{}", record.args()), level, record.target());
let _ = output_debug_string(&*format!("{}", record.args()), level, record.target());
}

fn flush(&self) {}
Expand Down
1 change: 0 additions & 1 deletion sm/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@

#[macro_use]
extern crate sunrise_libuser as libuser;
#[macro_use]
extern crate alloc;


Expand Down
1 change: 0 additions & 1 deletion vi/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#[macro_use]
extern crate sunrise_libuser as libuser;

#[macro_use]
extern crate alloc;


Expand Down

0 comments on commit 5fe3a38

Please # to comment.