Commit d14f1e6a authored by AdminXVII's avatar AdminXVII

Silence warnings

parent 3f3d1d4e
Pipeline #5641 passed with stage
in 2 minutes and 19 seconds
......@@ -394,16 +394,16 @@ impl<'a, W: io::Write> Editor<'a, W> {
}
if Some(index) == highlighted {
write!(
let _ = write!(
output_buf,
"{}{}",
color::Black.fg_str(),
color::White.bg_str()
);
}
write!(output_buf, "{:<1$}", com, col_width);
let _ = write!(output_buf, "{:<1$}", com, col_width);
if Some(index) == highlighted {
write!(
let _ = write!(
output_buf,
"{}{}",
color::Reset.bg_str(),
......@@ -531,7 +531,7 @@ impl<'a, W: io::Write> Editor<'a, W> {
/// Clears the screen then prints the prompt and current buffer.
pub fn clear(&mut self) -> io::Result<()> {
write!(
let _ = write!(
&mut self.context.buf,
"{}{}",
clear::All,
......@@ -931,14 +931,14 @@ impl<'a, W: io::Write> Editor<'a, W> {
// Move the term cursor to the same line as the prompt.
if self.term_cursor_line > 1 {
write!(
let _ = write!(
&mut self.context.buf,
"{}",
cursor::Up(self.term_cursor_line as u16 - 1)
);
}
write!(&mut self.context.buf, "\r{}", clear::AfterCursor);
let _ = write!(&mut self.context.buf, "\r{}", clear::AfterCursor);
// If we're cycling through completions, show those
let mut completion_lines = 0;
......@@ -949,7 +949,7 @@ impl<'a, W: io::Write> Editor<'a, W> {
}
// Write the prompt
write!(&mut self.context.buf, "{}", prompt);
let _ = write!(&mut self.context.buf, "{}", prompt);
// If we have an autosuggestion, we make the autosuggestion the buffer we print out.
// We get the number of bytes in the buffer (but NOT the autosuggestion).
......@@ -964,7 +964,7 @@ impl<'a, W: io::Write> Editor<'a, W> {
let lines_len = lines.len();
for (i, line) in lines.into_iter().enumerate() {
if i > 0 {
write!(
let _ = write!(
&mut self.context.buf,
"{}",
cursor::Right(prompt_width as u16)
......@@ -980,11 +980,11 @@ impl<'a, W: io::Write> Editor<'a, W> {
None => start.to_owned(),
};
if self.is_search() {
write!(&mut self.context.buf, "{}", color::Yellow.fg_str());
let _ = write!(&mut self.context.buf, "{}", color::Yellow.fg_str());
}
write!(&mut self.context.buf, "{}", start);
let _ = write!(&mut self.context.buf, "{}", start);
if !self.is_search() {
write!(&mut self.context.buf, "{}", color::Yellow.fg_str());
let _ = write!(&mut self.context.buf, "{}", color::Yellow.fg_str());
}
self.context.buf.push_str(&line[buf_num_remaining_bytes..]);
buf_num_remaining_bytes = 0;
......@@ -995,7 +995,7 @@ impl<'a, W: io::Write> Editor<'a, W> {
None => line,
};
if self.is_search() {
write!(&mut self.context.buf, "{}", color::Yellow.fg_str());
let _ = write!(&mut self.context.buf, "{}", color::Yellow.fg_str());
}
self.context.buf.push_str(&written_line);
}
......@@ -1006,7 +1006,7 @@ impl<'a, W: io::Write> Editor<'a, W> {
}
if self.is_currently_showing_autosuggestion() || self.is_search() {
write!(&mut self.context.buf, "{}", color::Reset.fg_str());
let _ = write!(&mut self.context.buf, "{}", color::Reset.fg_str());
}
// at the end of the line, move the cursor down a line
......@@ -1020,7 +1020,7 @@ impl<'a, W: io::Write> Editor<'a, W> {
// to the line where the true cursor is.
let cursor_line_diff = new_num_lines as isize - self.term_cursor_line as isize;
if cursor_line_diff > 0 {
write!(
let _ = write!(
&mut self.context.buf,
"{}",
cursor::Up(cursor_line_diff as u16)
......@@ -1035,13 +1035,13 @@ impl<'a, W: io::Write> Editor<'a, W> {
- new_total_width_to_cursor as isize
- cursor_line_diff * terminal_width as isize;
if cursor_col_diff > 0 {
write!(
let _ = write!(
&mut self.context.buf,
"{}",
cursor::Left(cursor_col_diff as u16)
);
} else if cursor_col_diff < 0 {
write!(
let _ = write!(
&mut self.context.buf,
"{}",
cursor::Right((-cursor_col_diff) as u16)
......@@ -1052,7 +1052,7 @@ impl<'a, W: io::Write> Editor<'a, W> {
{
let out = &mut self.out;
out.write_all(self.context.buf.as_bytes());
let _ = out.write_all(self.context.buf.as_bytes());
self.context.buf.clear();
out.flush()
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment