X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Flibterm%2Fterminfo%2Fmod.rs;h=c5e68eed4072541a2e81630dcc15345a8bd09122;hb=6f4ab9458a7ad06c8ce630604f533c8c0c0acef4;hp=e54f763fd0db795cd701365c9984212da16ffe27;hpb=df91cb9af69497e67e432c66ccba5182681b8917;p=rust.git diff --git a/src/libterm/terminfo/mod.rs b/src/libterm/terminfo/mod.rs index e54f763fd0d..c5e68eed407 100644 --- a/src/libterm/terminfo/mod.rs +++ b/src/libterm/terminfo/mod.rs @@ -109,7 +109,7 @@ pub fn from_path>(path: P) -> Result { } // Keep the metadata small fn _from_path(path: &Path) -> Result { - let file = try!(File::open(path).map_err(|e| Error::IoError(e))); + let file = File::open(path).map_err(|e| Error::IoError(e))?; let mut reader = BufReader::new(file); parse(&mut reader, false).map_err(|e| Error::MalformedTerminfo(e)) } @@ -190,7 +190,7 @@ fn supports_attr(&self, attr: Attr) -> bool { fn reset(&mut self) -> io::Result { // are there any terminals that have color/attrs and not sgr0? // Try falling back to sgr, then op - let cmd = match ["sg0", "sgr", "op"] + let cmd = match ["sgr0", "sgr", "op"] .iter() .filter_map(|cap| self.ti.strings.get(*cap)) .next() { @@ -231,7 +231,7 @@ pub fn new_with_terminfo(out: T, terminfo: TermInfo) -> TerminfoTerminal { }; TerminfoTerminal { - out: out, + out, ti: terminfo, num_colors: nc, }