Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libraries: match example values in documentation #1124

Merged
merged 1 commit into from Jul 18, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 5 additions & 6 deletions libraries/tock-register-interface/README.md
Expand Up @@ -170,11 +170,10 @@ let range: u8 = registers.cr.read(Control::RANGE);
// Or one can read `range` as a enum and `match` over it.
let range = registers.cr.read_as_enum(Control::RANGE);
match range {
Some(Control::RANGE::Value::Zero) => { /* ... */ }
Some(Control::RANGE::Value::One) => { /* ... */ }
Some(Control::RANGE::Value::Two) => { /* ... */ }
Some(Control::RANGE::Value::Three) => { /* ... */ }

Some(Control::RANGE::Value::VeryHigh) => { /* ... */ }
Some(Control::RANGE::Value::High) => { /* ... */ }
Some(Control::RANGE::Value::Low) => { /* ... */ }

None => unreachable!("invalid value")
}

Expand Down Expand Up @@ -250,7 +249,7 @@ let mode = registers.cr.read_as_enum(Status::MODE);
match mode {
Some(Status::MODE::FullDuplex) => { /* ... */ }
Some(Status::MODE::HalfDuplex) => { /* ... */ }

None => unreachable!("invalid value")
}

Expand Down