libterm: remove unnecessary as_slice()
calls
This commit is contained in:
parent
39f44c0c20
commit
53b479c195
@ -183,7 +183,7 @@ impl<T: Writer+Send> TerminfoTerminal<T> {
|
||||
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,
|
||||
|
@ -529,8 +529,7 @@ fn format(val: Param, op: FormatOp, flags: Flags) -> Result<Vec<u8> ,String> {
|
||||
}
|
||||
}
|
||||
FormatHEX => {
|
||||
s = s.as_slice()
|
||||
.to_ascii()
|
||||
s = s.to_ascii()
|
||||
.iter()
|
||||
.map(|b| b.to_uppercase().as_byte())
|
||||
.collect();
|
||||
|
@ -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<String> = names_str.as_slice()
|
||||
.split('|')
|
||||
let term_names: Vec<String> = names_str.split('|')
|
||||
.map(|s| s.to_string())
|
||||
.collect();
|
||||
|
||||
|
@ -37,7 +37,7 @@ pub fn get_dbpath_for_term(term: &str) -> Option<Box<Path>> {
|
||||
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 {
|
||||
|
Loading…
Reference in New Issue
Block a user