mirror of
https://github.com/FliegendeWurst/cursive.git
synced 2024-11-23 17:35:00 +00:00
Fix clippy warnings
This commit is contained in:
parent
6f129ac83d
commit
e0b279d9df
@ -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);
|
||||
|
@ -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();
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user