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());
|
let entry = open(term.as_slice());
|
||||||
if entry.is_err() {
|
if entry.is_err() {
|
||||||
if os::getenv("MSYSCON").map_or(false, |s| {
|
if os::getenv("MSYSCON").map_or(false, |s| {
|
||||||
"mintty.exe" == s.as_slice()
|
"mintty.exe" == s
|
||||||
}) {
|
}) {
|
||||||
// msys terminal
|
// msys terminal
|
||||||
return Some(box TerminfoTerminal {out: out,
|
return Some(box TerminfoTerminal {out: out,
|
||||||
|
@ -529,8 +529,7 @@ fn format(val: Param, op: FormatOp, flags: Flags) -> Result<Vec<u8> ,String> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
FormatHEX => {
|
FormatHEX => {
|
||||||
s = s.as_slice()
|
s = s.to_ascii()
|
||||||
.to_ascii()
|
|
||||||
.iter()
|
.iter()
|
||||||
.map(|b| b.to_uppercase().as_byte())
|
.map(|b| b.to_uppercase().as_byte())
|
||||||
.collect();
|
.collect();
|
||||||
|
@ -218,8 +218,7 @@ pub fn parse(file: &mut io::Reader, longnames: bool)
|
|||||||
Err(_) => return Err("input not utf-8".to_string()),
|
Err(_) => return Err("input not utf-8".to_string()),
|
||||||
};
|
};
|
||||||
|
|
||||||
let term_names: Vec<String> = names_str.as_slice()
|
let term_names: Vec<String> = names_str.split('|')
|
||||||
.split('|')
|
|
||||||
.map(|s| s.to_string())
|
.map(|s| s.to_string())
|
||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@ pub fn get_dbpath_for_term(term: &str) -> Option<Box<Path>> {
|
|||||||
dirs_to_search.push(homedir.unwrap().join(".terminfo"))
|
dirs_to_search.push(homedir.unwrap().join(".terminfo"))
|
||||||
}
|
}
|
||||||
match getenv("TERMINFO_DIRS") {
|
match getenv("TERMINFO_DIRS") {
|
||||||
Some(dirs) => for i in dirs.as_slice().split(':') {
|
Some(dirs) => for i in dirs.split(':') {
|
||||||
if i == "" {
|
if i == "" {
|
||||||
dirs_to_search.push(Path::new("/usr/share/terminfo"));
|
dirs_to_search.push(Path::new("/usr/share/terminfo"));
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user