You've already forked comprehensive-rust
mirror of
https://github.com/google/comprehensive-rust.git
synced 2025-07-04 13:50:28 +02:00
Minor tweaks to std traits slides (#2738)
This commit is contained in:
committed by
GitHub
parent
b897e43892
commit
e23843e5e3
@ -4,7 +4,7 @@ minutes: 5
|
|||||||
|
|
||||||
# The `Default` Trait
|
# 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
|
```rust,editable
|
||||||
#[derive(Debug, Default)]
|
#[derive(Debug, Default)]
|
||||||
|
@ -53,7 +53,7 @@ mod test {
|
|||||||
#[test]
|
#[test]
|
||||||
fn binary() {
|
fn binary() {
|
||||||
let input: Vec<u8> = (0..=255u8).collect();
|
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];
|
let mut buf = [0u8; 256];
|
||||||
assert_eq!(rot.read(&mut buf).unwrap(), 256);
|
assert_eq!(rot.read(&mut buf).unwrap(), 256);
|
||||||
for i in 0..=255 {
|
for i in 0..=255 {
|
||||||
|
Reference in New Issue
Block a user