Commit a448f510 authored by Jeremy Soller's avatar Jeremy Soller

1.5.5 - fix warnings

parent 6cb4e3fb
Pipeline #6867 passed with stages
in 6 minutes and 31 seconds
[package]
name = "termion"
version = "1.5.4"
version = "1.5.5"
authors = ["ticki <Ticki@users.noreply.github.com>", "gycos <alexandre.bury@gmail.com>", "IGI-111 <igi-111@protonmail.com>"]
description = "A bindless library for manipulating terminals."
repository = "https://gitlab.redox-os.org/redox-os/termion"
......
......@@ -119,8 +119,8 @@ pub fn parse_event<I>(item: u8, iter: &mut I) -> Result<Event, Error>
parse_csi(iter).ok_or(error)?
}
Some(Ok(c)) => {
let ch = parse_utf8_char(c, iter);
Event::Key(Key::Alt(try!(ch)))
let ch = parse_utf8_char(c, iter)?;
Event::Key(Key::Alt(ch))
}
Some(Err(_)) | None => return Err(error),
})
......@@ -133,8 +133,8 @@ pub fn parse_event<I>(item: u8, iter: &mut I) -> Result<Event, Error>
b'\0' => Ok(Event::Key(Key::Null)),
c => {
Ok({
let ch = parse_utf8_char(c, iter);
Event::Key(Key::Char(try!(ch)))
let ch = parse_utf8_char(c, iter)?;
Event::Key(Key::Char(ch))
})
}
}
......
......@@ -121,7 +121,7 @@ pub trait TermRead {
/// EOT and ETX will abort the prompt, returning `None`. Newline or carriage return will
/// complete the input.
fn read_passwd<W: Write>(&mut self, writer: &mut W) -> io::Result<Option<String>> {
let _raw = try!(writer.into_raw_mode());
let _raw = writer.into_raw_mode()?;
self.read_line()
}
}
......@@ -152,8 +152,8 @@ impl<R: Read + TermReadEventsAndRaw> TermRead for R {
}
}
let string = try!(String::from_utf8(buf)
.map_err(|e| io::Error::new(io::ErrorKind::InvalidData, e)));
let string = String::from_utf8(buf)
.map_err(|e| io::Error::new(io::ErrorKind::InvalidData, e))?;
Ok(Some(string))
}
}
......
......@@ -102,11 +102,13 @@ impl<W: Write> IntoRawMode for W {
}
impl<W: Write> RawTerminal<W> {
/// Temporarily switch to original mode
pub fn suspend_raw_mode(&self) -> io::Result<()> {
set_terminal_attr(&self.prev_ios)?;
Ok(())
}
/// Temporarily switch to raw mode
pub fn activate_raw_mode(&self) -> io::Result<()> {
let mut ios = get_terminal_attr()?;
raw_terminal_attr(&mut ios);
......
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