mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-30 04:27:45 +00:00
more: change file unwrap to match
This commit is contained in:
parent
4b33223854
commit
d41777c52c
1 changed files with 10 additions and 1 deletions
|
@ -104,7 +104,16 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
|
||||||
if length > 1 {
|
if length > 1 {
|
||||||
buff.push_str(&MULTI_FILE_TOP_PROMPT.replace("{}", file.to_str().unwrap()));
|
buff.push_str(&MULTI_FILE_TOP_PROMPT.replace("{}", file.to_str().unwrap()));
|
||||||
}
|
}
|
||||||
let mut reader = BufReader::new(File::open(file).unwrap());
|
let opened_file = match File::open(file) {
|
||||||
|
Err(why) => {
|
||||||
|
return Err(UUsageError::new(
|
||||||
|
1,
|
||||||
|
format!("cannot open {}: {}", file.quote(), why.kind()),
|
||||||
|
))
|
||||||
|
}
|
||||||
|
Ok(opened_file) => opened_file,
|
||||||
|
};
|
||||||
|
let mut reader = BufReader::new(opened_file);
|
||||||
reader.read_to_string(&mut buff).unwrap();
|
reader.read_to_string(&mut buff).unwrap();
|
||||||
more(&buff, &mut stdout, next_file.copied(), &options)?;
|
more(&buff, &mut stdout, next_file.copied(), &options)?;
|
||||||
buff.clear();
|
buff.clear();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue