mirror of
https://github.com/phil-opp/blog_os.git
synced 2025-12-16 22:37:49 +00:00
Update blog to a6632af0b6
This commit is contained in:
@@ -232,8 +232,7 @@ The `Ok(())` is just a `Ok` Result containing the `()` type. We can drop the `pu
|
|||||||
Now we can use Rust's built-in `write!`/`writeln!` formatting macros:
|
Now we can use Rust's built-in `write!`/`writeln!` formatting macros:
|
||||||
|
|
||||||
```rust
|
```rust
|
||||||
...
|
let mut writer = Writer {...};
|
||||||
let mut writer = Writer::new(Color::Blue, Color::LightGreen);
|
|
||||||
writer.write_byte(b'H');
|
writer.write_byte(b'H');
|
||||||
writer.write_str("ello! ");
|
writer.write_str("ello! ");
|
||||||
write!(writer, "The numbers are {} and {}", 42, 1.0/3.0);
|
write!(writer, "The numbers are {} and {}", 42, 1.0/3.0);
|
||||||
|
|||||||
Reference in New Issue
Block a user