Skip to content
Snippets Groups Projects
Commit 881f26da authored by Michal Sojka's avatar Michal Sojka
Browse files

lab5: Simplify input reading template for Rust

parent 379816a8
No related branches found
No related tags found
No related merge requests found
Pipeline #55243 passed
......@@ -121,14 +121,11 @@ potřeba uvolnit funkcí `free()`.
{{< tab "Rust" >}}
```rust
for line in std::io::stdin().lock().lines().map(|l| l.unwrap()) {
match line.split_once(' ') {
Some((num, word)) => {
let x = num.parse::<usize>()?;
// ....
}
None => {
// ...
}
if let Some((num, word)) = line.split_once(' ') {
let x = num.parse::<usize>()?;
// ...
} else {
// ...
};
}
```
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment