diff options
author | Toby Vincent <tobyv13@gmail.com> | 2022-12-03 21:54:02 -0600 |
---|---|---|
committer | Toby Vincent <tobyv13@gmail.com> | 2022-12-03 21:54:02 -0600 |
commit | 32fa816a16c6ba5a26ad69fb8f30134836a093f5 (patch) | |
tree | 610d44cb7be2ba569f6d3beffc563be5bdbbe0b6 | |
parent | 70ee2f14ca1de7e1393907c00f323325564cdddd (diff) |
refactor: inline UNKNOWN const
-rw-r--r-- | src/lib.rs | 4 |
1 files changed, 1 insertions, 3 deletions
@@ -30,8 +30,6 @@ Examples: cat f - g Output f's contents, then standard input, then g's contents. cat Copy standard input to standard output."#; -const UNKNOWN_CHAR: &[u8; 2] = b"^?"; - pub fn run(cli: Cli) -> Result<()> { let stdout = std::io::stdout(); let mut writer = stdout.lock(); @@ -97,7 +95,7 @@ fn process_nonprinting(mut c: u8) -> Vec<u8> { match c { c @ 0..=31 => buf.extend([b'^', c + 64]), c @ 32..=126 => buf.push(c), - 127.. => buf.extend(UNKNOWN_CHAR), + 127.. => buf.extend(b"^?"), }; buf |