Skip to content

Commit 53b479c

Browse files
author
Jorge Aparicio
committed
libterm: remove unnecessary as_slice() calls
1 parent 39f44c0 commit 53b479c

File tree

4 files changed

+4
-6
lines changed

4 files changed

+4
-6
lines changed

src/libterm/terminfo/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ impl<T: Writer+Send> TerminfoTerminal<T> {
183183
let entry = open(term.as_slice());
184184
if entry.is_err() {
185185
if os::getenv("MSYSCON").map_or(false, |s| {
186-
"mintty.exe" == s.as_slice()
186+
"mintty.exe" == s
187187
}) {
188188
// msys terminal
189189
return Some(box TerminfoTerminal {out: out,

src/libterm/terminfo/parm.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -529,8 +529,7 @@ fn format(val: Param, op: FormatOp, flags: Flags) -> Result<Vec<u8> ,String> {
529529
}
530530
}
531531
FormatHEX => {
532-
s = s.as_slice()
533-
.to_ascii()
532+
s = s.to_ascii()
534533
.iter()
535534
.map(|b| b.to_uppercase().as_byte())
536535
.collect();

src/libterm/terminfo/parser/compiled.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,8 +218,7 @@ pub fn parse(file: &mut io::Reader, longnames: bool)
218218
Err(_) => return Err("input not utf-8".to_string()),
219219
};
220220

221-
let term_names: Vec<String> = names_str.as_slice()
222-
.split('|')
221+
let term_names: Vec<String> = names_str.split('|')
223222
.map(|s| s.to_string())
224223
.collect();
225224

src/libterm/terminfo/searcher.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ pub fn get_dbpath_for_term(term: &str) -> Option<Box<Path>> {
3737
dirs_to_search.push(homedir.unwrap().join(".terminfo"))
3838
}
3939
match getenv("TERMINFO_DIRS") {
40-
Some(dirs) => for i in dirs.as_slice().split(':') {
40+
Some(dirs) => for i in dirs.split(':') {
4141
if i == "" {
4242
dirs_to_search.push(Path::new("/usr/share/terminfo"));
4343
} else {

0 commit comments

Comments
 (0)