Fix clippy warnings

This commit is contained in:
Alexandre Bury 2017-03-05 15:18:15 -08:00
parent 6f129ac83d
commit e0b279d9df
3 changed files with 6 additions and 6 deletions

View File

@ -22,8 +22,8 @@ fn main() {
let (tx, rx) = mpsc::channel();
// Generate data in a separate thread.
thread::spawn(|| {
generate_logs(tx);
thread::spawn(move || {
generate_logs(&tx);
});
// And sets the view to read from the other end of the channel.
@ -34,7 +34,7 @@ fn main() {
// We will only simulate log generation here.
// In real life, this may come from a running task, a separate process, ...
fn generate_logs(tx: mpsc::Sender<String>) {
fn generate_logs(tx: &mpsc::Sender<String>) {
let mut i = 1;
loop {
let line = format!("Interesting log line {}", i);

View File

@ -28,7 +28,7 @@ fn main() {
}
// Function to simulate a long process.
fn fake_load(n_max: usize, counter: Counter) {
fn fake_load(n_max: usize, counter: &Counter) {
for _ in 0..n_max {
thread::sleep(Duration::from_millis(5));
// The `counter.tick()` method increases the progress value
@ -50,7 +50,7 @@ fn phase_1(s: &mut Cursive) {
.range(0, n_max)
.with_task(move |counter| {
// This closure will be called in a separate thread.
fake_load(n_max, counter);
fake_load(n_max, &counter);
// When we're done, send a callback through the channel
cb.send(Box::new(coffee_break)).unwrap();

View File

@ -267,7 +267,7 @@ fn make_small_stars(length: usize) -> &'static str {
impl View for EditView {
fn draw(&self, printer: &Printer) {
assert!(printer.size.x == self.last_length,
assert_eq!(printer.size.x, self.last_length,
"Was promised {}, received {}",
self.last_length,
printer.size.x);