From 53b479c1953216733e02120d136b2e99e368cc8e Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Thu, 27 Nov 2014 15:03:37 -0500 Subject: [PATCH] libterm: remove unnecessary `as_slice()` calls --- src/libterm/terminfo/mod.rs | 2 +- src/libterm/terminfo/parm.rs | 3 +-- src/libterm/terminfo/parser/compiled.rs | 3 +-- src/libterm/terminfo/searcher.rs | 2 +- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/libterm/terminfo/mod.rs b/src/libterm/terminfo/mod.rs index c1393767c8a..65f8415835a 100644 --- a/src/libterm/terminfo/mod.rs +++ b/src/libterm/terminfo/mod.rs @@ -183,7 +183,7 @@ impl TerminfoTerminal { let entry = open(term.as_slice()); if entry.is_err() { if os::getenv("MSYSCON").map_or(false, |s| { - "mintty.exe" == s.as_slice() + "mintty.exe" == s }) { // msys terminal return Some(box TerminfoTerminal {out: out, diff --git a/src/libterm/terminfo/parm.rs b/src/libterm/terminfo/parm.rs index d644542db07..3a9d8619c31 100644 --- a/src/libterm/terminfo/parm.rs +++ b/src/libterm/terminfo/parm.rs @@ -529,8 +529,7 @@ fn format(val: Param, op: FormatOp, flags: Flags) -> Result ,String> { } } FormatHEX => { - s = s.as_slice() - .to_ascii() + s = s.to_ascii() .iter() .map(|b| b.to_uppercase().as_byte()) .collect(); diff --git a/src/libterm/terminfo/parser/compiled.rs b/src/libterm/terminfo/parser/compiled.rs index 9eb7216fba0..9b5e6f5cc9f 100644 --- a/src/libterm/terminfo/parser/compiled.rs +++ b/src/libterm/terminfo/parser/compiled.rs @@ -218,8 +218,7 @@ pub fn parse(file: &mut io::Reader, longnames: bool) Err(_) => return Err("input not utf-8".to_string()), }; - let term_names: Vec = names_str.as_slice() - .split('|') + let term_names: Vec = names_str.split('|') .map(|s| s.to_string()) .collect(); diff --git a/src/libterm/terminfo/searcher.rs b/src/libterm/terminfo/searcher.rs index 94e234291af..2c1d76c7a40 100644 --- a/src/libterm/terminfo/searcher.rs +++ b/src/libterm/terminfo/searcher.rs @@ -37,7 +37,7 @@ pub fn get_dbpath_for_term(term: &str) -> Option> { dirs_to_search.push(homedir.unwrap().join(".terminfo")) } match getenv("TERMINFO_DIRS") { - Some(dirs) => for i in dirs.as_slice().split(':') { + Some(dirs) => for i in dirs.split(':') { if i == "" { dirs_to_search.push(Path::new("/usr/share/terminfo")); } else {