monitoring kit
Diffstat (limited to 'cpu/src/cpu.rs')
-rw-r--r--cpu/src/cpu.rs22
1 files changed, 13 insertions, 9 deletions
diff --git a/cpu/src/cpu.rs b/cpu/src/cpu.rs
index 459eef3..00feb75 100644
--- a/cpu/src/cpu.rs
+++ b/cpu/src/cpu.rs
@@ -11,6 +11,7 @@ use comat::cwrite;
use cpu::*;
use grapher::Grapher;
use std::array;
+use std::convert::identity;
use std::io::Write;
use std::io::{stdout, Read};
use std::thread::sleep;
@@ -62,16 +63,19 @@ fn main() -> Result<()> {
}
}
- g.draw(|y| {
- Some(
- inter(
- [243, 64, 64].map(|x| x as f32 / 255.0), // red
- [228, 197, 63].map(|x| x as f32 / 255.0), // yellow
- y as f32 / (h - 1) as f32,
+ g.draw(
+ |y| {
+ Some(
+ inter(
+ [243, 64, 64].map(|x| x as f32 / 255.0), // red
+ [228, 197, 63].map(|x| x as f32 / 255.0), // yellow
+ y as f32 / (h - 1) as f32,
+ )
+ .map(|x| (x * 255.0) as u8),
)
- .map(|x| (x * 255.0) as u8),
- )
- })?;
+ },
+ identity,
+ )?;
write!(g.buffer, "{}{}", White.fg_str(), cursor::Goto(1, 1))?;
let name = &*info.name;