Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace MappedWrite's magic u8 constant with byte string literal (#780)
The `NEWLINE_ASCII_BYTE` constant only really existed because it's otherwise not obvious that the `0x0Au8` u8 value represents an ASCII newline byte. However, we can replace the `0x0Au8` u8 with a byte string literal of `b'\n'` which is identical in it's value, but much easier to reason about. The byte string literal form is what the Rust stdlib uses in several places: https://github.com/rust-lang/rust/blob/1.76.0/library/core/src/num/mod.rs#L1023 https://github.com/rust-lang/rust/blob/1.76.0/library/core/src/escape.rs#L20 https://github.com/rust-lang/rust/blob/1.76.0/library/std/src/io/buffered/linewritershim.rs#L47
- Loading branch information