1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-30 04:27:45 +00:00

Fix MSRV issue

This commit is contained in:
Andrew Liebenow 2024-09-22 08:36:16 -05:00
parent cdebd24733
commit 2d09037c67

View file

@ -308,7 +308,7 @@ mod fast_encode {
use std::{ use std::{
collections::VecDeque, collections::VecDeque,
io::{self, ErrorKind, Read, StdoutLock, Write}, io::{self, ErrorKind, Read, StdoutLock, Write},
num::{NonZero, NonZeroUsize}, num::NonZeroUsize,
}; };
use uucore::{ use uucore::{
encoding::SupportsFastEncode, encoding::SupportsFastEncode,
@ -424,12 +424,12 @@ mod fast_encode {
Some(0_usize) => None, Some(0_usize) => None,
// A custom line wrapping value was passed // A custom line wrapping value was passed
Some(an) => Some(LineWrapping { Some(an) => Some(LineWrapping {
line_length: NonZero::new(an).unwrap(), line_length: NonZeroUsize::new(an).unwrap(),
print_buffer: Vec::<u8>::new(), print_buffer: Vec::<u8>::new(),
}), }),
// Line wrapping was not set, so the default is used // Line wrapping was not set, so the default is used
None => Some(LineWrapping { None => Some(LineWrapping {
line_length: NonZero::new(WRAP_DEFAULT).unwrap(), line_length: NonZeroUsize::new(WRAP_DEFAULT).unwrap(),
print_buffer: Vec::<u8>::new(), print_buffer: Vec::<u8>::new(),
}), }),
}; };
@ -579,7 +579,7 @@ mod fast_decode {
// Note: "true" here // Note: "true" here
let mut table = [true; 256_usize]; let mut table = [true; 256_usize];
// Pass through all characters except '\n' and '\r' to // Pass through all characters except '\n' and '\r'
for ue in [b'\n', b'\r'] { for ue in [b'\n', b'\r'] {
let us = usize::from(ue); let us = usize::from(ue);