General cleanup

This commit is contained in:
4yn
2022-01-29 02:51:09 +08:00
parent 5694d39577
commit 05ff89b923
9 changed files with 127 additions and 69 deletions
+19 -19
View File
@@ -2,29 +2,29 @@ extern crate slidershim;
use std::io;
use slidershim::slider_io::worker::{Job, Worker};
// use slidershim::slider_io::worker::{Job, Worker};
struct TestJob {
data: i64,
}
// struct TestJob {
// data: i64,
// }
impl Job for TestJob {
fn setup(&mut self) {
self.data = 10;
println!("setup {}", self.data);
}
fn tick(&mut self) {
self.data -= 1;
println!("tick {}", self.data);
}
fn teardown(&mut self) {
self.data = 11;
println!("teardown {}", self.data);
}
}
// impl Job for TestJob {
// fn setup(&mut self) {
// self.data = 10;
// println!("setup {}", self.data);
// }
// fn tick(&mut self) {
// self.data -= 1;
// println!("tick {}", self.data);
// }
// fn teardown(&mut self) {
// self.data = 11;
// println!("teardown {}", self.data);
// }
// }
fn main() {
let worker = Worker::new(TestJob { data: 1 });
// let worker = Worker::new(TestJob { data: 1 });
let mut input = String::new();
let string = io::stdin().read_line(&mut input).unwrap();