mirror of
https://github.com/google/comprehensive-rust.git
synced 2025-05-16 23:55:42 +02:00
Minor tweaks to std traits slides (#2738)
This commit is contained in:
parent
b897e43892
commit
e23843e5e3
@ -4,7 +4,7 @@ minutes: 5
|
||||
|
||||
# The `Default` Trait
|
||||
|
||||
[`Default`][1] trait produces a default value for a type.
|
||||
The [`Default`][1] trait produces a default value for a type.
|
||||
|
||||
```rust,editable
|
||||
#[derive(Debug, Default)]
|
||||
|
@ -53,7 +53,7 @@ mod test {
|
||||
#[test]
|
||||
fn binary() {
|
||||
let input: Vec<u8> = (0..=255u8).collect();
|
||||
let mut rot = RotDecoder::<&[u8]> { input: input.as_ref(), rot: 13 };
|
||||
let mut rot = RotDecoder::<&[u8]> { input: input.as_slice(), rot: 13 };
|
||||
let mut buf = [0u8; 256];
|
||||
assert_eq!(rot.read(&mut buf).unwrap(), 256);
|
||||
for i in 0..=255 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user