diff options
| author | Richo Healey <richo@psych0tik.net> | 2014-05-22 16:57:53 -0700 |
|---|---|---|
| committer | Richo Healey <richo@psych0tik.net> | 2014-05-24 21:48:10 -0700 |
| commit | 553074506ecd139eb961fb91eb33ad9fd0183acb (patch) | |
| tree | 01682cf8147183250713acf5e8a77265aab7153c /src/libterm/terminfo | |
| parent | bbb70cdd9cd982922cf7390459d53bde409699ae (diff) | |
| download | rust-553074506ecd139eb961fb91eb33ad9fd0183acb.tar.gz rust-553074506ecd139eb961fb91eb33ad9fd0183acb.zip | |
core: rename strbuf::StrBuf to string::String
[breaking-change]
Diffstat (limited to 'src/libterm/terminfo')
| -rw-r--r-- | src/libterm/terminfo/mod.rs | 8 | ||||
| -rw-r--r-- | src/libterm/terminfo/parm.rs | 6 | ||||
| -rw-r--r-- | src/libterm/terminfo/parser/compiled.rs | 4 | ||||
| -rw-r--r-- | src/libterm/terminfo/searcher.rs | 4 |
4 files changed, 11 insertions, 11 deletions
diff --git a/src/libterm/terminfo/mod.rs b/src/libterm/terminfo/mod.rs index 7562bf2d163..716f96b1872 100644 --- a/src/libterm/terminfo/mod.rs +++ b/src/libterm/terminfo/mod.rs @@ -26,13 +26,13 @@ use self::parm::{expand, Number, Variables}; #[deriving(Show)] pub struct TermInfo { /// Names for the terminal - pub names: Vec<StrBuf> , + pub names: Vec<String> , /// Map of capability name to boolean value - pub bools: HashMap<StrBuf, bool>, + pub bools: HashMap<String, bool>, /// Map of capability name to numeric value - pub numbers: HashMap<StrBuf, u16>, + pub numbers: HashMap<String, u16>, /// Map of capability name to raw (unexpanded) string - pub strings: HashMap<StrBuf, Vec<u8> > + pub strings: HashMap<String, Vec<u8> > } pub mod searcher; diff --git a/src/libterm/terminfo/parm.rs b/src/libterm/terminfo/parm.rs index ed94de8e81d..6b96a78b24d 100644 --- a/src/libterm/terminfo/parm.rs +++ b/src/libterm/terminfo/parm.rs @@ -41,7 +41,7 @@ enum FormatState { #[allow(missing_doc)] #[deriving(Clone)] pub enum Param { - String(StrBuf), + String(String), Number(int) } @@ -89,7 +89,7 @@ impl Variables { multiple capabilities for the same terminal. */ pub fn expand(cap: &[u8], params: &[Param], vars: &mut Variables) - -> Result<Vec<u8> , StrBuf> { + -> Result<Vec<u8> , String> { let mut state = Nothing; // expanded cap will only rarely be larger than the cap itself @@ -483,7 +483,7 @@ impl FormatOp { } } -fn format(val: Param, op: FormatOp, flags: Flags) -> Result<Vec<u8> ,StrBuf> { +fn format(val: Param, op: FormatOp, flags: Flags) -> Result<Vec<u8> ,String> { let mut s = match val { Number(d) => { let s = match (op, flags.sign) { diff --git a/src/libterm/terminfo/parser/compiled.rs b/src/libterm/terminfo/parser/compiled.rs index 687e27f4282..5625a14a4f2 100644 --- a/src/libterm/terminfo/parser/compiled.rs +++ b/src/libterm/terminfo/parser/compiled.rs @@ -160,7 +160,7 @@ pub static stringnames: &'static[&'static str] = &'static[ "cbt", "_", "cr", "cs /// Parse a compiled terminfo entry, using long capability names if `longnames` is true pub fn parse(file: &mut io::Reader, longnames: bool) - -> Result<Box<TermInfo>, StrBuf> { + -> Result<Box<TermInfo>, String> { macro_rules! try( ($e:expr) => ( match $e { Ok(e) => e, @@ -221,7 +221,7 @@ pub fn parse(file: &mut io::Reader, longnames: bool) None => return Err("input not utf-8".to_strbuf()), }; - let term_names: Vec<StrBuf> = names_str.as_slice() + let term_names: Vec<String> = names_str.as_slice() .split('|') .map(|s| s.to_strbuf()) .collect(); diff --git a/src/libterm/terminfo/searcher.rs b/src/libterm/terminfo/searcher.rs index ac5737c46ed..5c800c75432 100644 --- a/src/libterm/terminfo/searcher.rs +++ b/src/libterm/terminfo/searcher.rs @@ -76,7 +76,7 @@ pub fn get_dbpath_for_term(term: &str) -> Option<Box<Path>> { } /// Return open file for `term` -pub fn open(term: &str) -> Result<File, StrBuf> { +pub fn open(term: &str) -> Result<File, String> { match get_dbpath_for_term(term) { Some(x) => { match File::open(x) { @@ -97,7 +97,7 @@ fn test_get_dbpath_for_term() { // note: current tests won't work with non-standard terminfo hierarchies (e.g. OS X's) use std::os::{setenv, unsetenv}; // FIXME (#9639): This needs to handle non-utf8 paths - fn x(t: &str) -> StrBuf { + fn x(t: &str) -> String { let p = get_dbpath_for_term(t).expect("no terminfo entry found"); p.as_str().unwrap().to_strbuf() }; |
