Skip to content

Commit 86e7856

Browse files
committed
sh: fix clippy errors
1 parent b4690b6 commit 86e7856

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

sh/src/main.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ fn print_line(line: &[u8], mut cursor_position: usize, shell: &mut Shell, print_
6161
print!("{}", ps1);
6262
cursor_position += ps1.len();
6363
}
64-
std::io::stdout().write(&line).unwrap();
64+
std::io::stdout().write_all(&line).unwrap();
6565
set_cursor_pos(cursor_position);
6666
io::stdout().flush().unwrap();
6767
}
@@ -100,7 +100,7 @@ fn standard_repl(shell: &mut Shell) {
100100
continue;
101101
}
102102
};
103-
print!("\n");
103+
println!();
104104
shell.terminal.reset();
105105
match shell.execute_program(program_string) {
106106
Ok(_) => {
@@ -157,7 +157,7 @@ fn vi_repl(shell: &mut Shell) {
157157
continue;
158158
}
159159
};
160-
print!("\n");
160+
println!();
161161
shell.terminal.reset();
162162
match shell.execute_program(program_string) {
163163
Ok(_) => {
@@ -195,7 +195,7 @@ fn vi_repl(shell: &mut Shell) {
195195
print!("{}", ps1);
196196
cursor_position += ps1.len();
197197
}
198-
std::io::stdout().write(editor.current_line(shell)).unwrap();
198+
std::io::stdout().write_all(editor.current_line(shell)).unwrap();
199199
set_cursor_pos(cursor_position);
200200
io::stdout().flush().unwrap();
201201
}

sh/src/wordexp/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ pub fn expand_word(
249249

250250
pub fn word_to_pattern(word: &Word, shell: &mut Shell) -> ExpansionResult<Pattern> {
251251
let mut expanded_word = ExpandedWord::default();
252-
simple_word_expansion_into(&mut expanded_word, &word, false, shell)?;
252+
simple_word_expansion_into(&mut expanded_word, word, false, shell)?;
253253
Pattern::new(&expanded_word).map_err(CommandExecutionError::ExpansionError)
254254
}
255255

0 commit comments

Comments
 (0)