Skip to content
Snippets Groups Projects
Commit cb056d3a authored by gwenn's avatar gwenn
Browse files

Fix warnings

parent 9b9c3527
No related branches found
No related tags found
No related merge requests found
...@@ -344,7 +344,6 @@ fn reverse_incremental_search<R: RawReader>( ...@@ -344,7 +344,6 @@ fn reverse_incremental_search<R: RawReader>(
/// Handles reading and editting the readline buffer. /// Handles reading and editting the readline buffer.
/// It will also handle special inputs in an appropriate fashion /// It will also handle special inputs in an appropriate fashion
/// (e.g., C-c will exit readline) /// (e.g., C-c will exit readline)
#[allow(let_unit_value)]
fn readline_edit<H: Helper>( fn readline_edit<H: Helper>(
prompt: &str, prompt: &str,
initial: Option<(&str, &str)>, initial: Option<(&str, &str)>,
...@@ -581,6 +580,9 @@ fn readline_edit<H: Helper>( ...@@ -581,6 +580,9 @@ fn readline_edit<H: Helper>(
} }
} }
} }
if cfg!(windows) {
let _ = original_mode; // silent warning
}
Ok(s.line.into_string()) Ok(s.line.into_string())
} }
......
...@@ -31,8 +31,8 @@ fn get_win_size() -> (usize, usize) { ...@@ -31,8 +31,8 @@ fn get_win_size() -> (usize, usize) {
unsafe { unsafe {
let mut size: libc::winsize = zeroed(); let mut size: libc::winsize = zeroed();
match libc::ioctl(STDOUT_FILENO, libc::TIOCGWINSZ.into(), &mut size) { // https://github.com/rust-lang/libc/pull/704
// .into() for FreeBSD match libc::ioctl(STDOUT_FILENO, libc::TIOCGWINSZ as libc::c_ulong, &mut size) {
0 => (size.ws_col as usize, size.ws_row as usize), // TODO getCursorPosition 0 => (size.ws_col as usize, size.ws_row as usize), // TODO getCursorPosition
_ => (80, 24), _ => (80, 24),
} }
...@@ -487,7 +487,6 @@ impl Renderer for PosixRenderer { ...@@ -487,7 +487,6 @@ impl Renderer for PosixRenderer {
/// Control characters are treated as having zero width. /// Control characters are treated as having zero width.
/// Characters with 2 column width are correctly handled (not splitted). /// Characters with 2 column width are correctly handled (not splitted).
#[allow(if_same_then_else)]
fn calculate_position(&self, s: &str, orig: Position) -> Position { fn calculate_position(&self, s: &str, orig: Position) -> Position {
let mut pos = orig; let mut pos = orig;
let mut esc_seq = 0; let mut esc_seq = 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment