mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2026-01-16 02:01:05 +00:00
stdin() is already buffered. Locking upfront explicitely avoid the overhead of mutex locking/unlocking everytime a new line is read. See https://stackoverflow.com/a/17546731 and https://www.reddit.com/r/rust/comments/3rj54u/how_can_i_read_char_by_char_from_stdin/cwpojn1/ The code cannot be simplified to “for line in stdin().lock().lines()” until non-lexical lifetimes are implemented. The compiler complains at the moment about a temporary value not living long enough/being dropped while still borrowed. See https://github.com/rust-lang/rust/issues/33520 This commit is related to issue #1103. |
||
|---|---|---|
| .. | ||
| build.rs | ||
| Cargo.toml | ||
| factor.rs | ||
| numeric.rs | ||
| sieve.rs | ||