mirror of
https://github.com/nushell/nushell.git
synced 2025-08-10 05:38:19 +02:00
Clippy fixes for new Rust version (#3392)
This commit is contained in:
@ -68,18 +68,16 @@ pub fn chop() {
|
||||
let stdin = io::stdin();
|
||||
let mut stdout = io::stdout();
|
||||
|
||||
for line in stdin.lock().lines() {
|
||||
if let Ok(given) = line {
|
||||
let chopped = if given.is_empty() {
|
||||
&given
|
||||
} else {
|
||||
let to = given.len() - 1;
|
||||
&given[..to]
|
||||
};
|
||||
for given in stdin.lock().lines().flatten() {
|
||||
let chopped = if given.is_empty() {
|
||||
&given
|
||||
} else {
|
||||
let to = given.len() - 1;
|
||||
&given[..to]
|
||||
};
|
||||
|
||||
if let Err(_e) = writeln!(stdout, "{}", chopped) {
|
||||
break;
|
||||
}
|
||||
if let Err(_e) = writeln!(stdout, "{}", chopped) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user