diff options
| author | Aaron Turon <aturon@mozilla.com> | 2014-11-12 15:51:51 -0800 |
|---|---|---|
| committer | Aaron Turon <aturon@mozilla.com> | 2014-11-17 11:26:48 -0800 |
| commit | 7213de1c49e448c7c6ad2d30dc3e6b3a13e090df (patch) | |
| tree | 9133e9f7b6f954432eddd947cb74248a1751ea36 /src/libterm/terminfo/mod.rs | |
| parent | 80a2867ea736007397aa2fbaa0e4c539c80e162c (diff) | |
| download | rust-7213de1c49e448c7c6ad2d30dc3e6b3a13e090df.tar.gz rust-7213de1c49e448c7c6ad2d30dc3e6b3a13e090df.zip | |
Fallout from deprecation
This commit handles the fallout from deprecating `_with` and `_equiv` methods.
Diffstat (limited to 'src/libterm/terminfo/mod.rs')
| -rw-r--r-- | src/libterm/terminfo/mod.rs | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/libterm/terminfo/mod.rs b/src/libterm/terminfo/mod.rs index 0b5092a64d0..c1393767c8a 100644 --- a/src/libterm/terminfo/mod.rs +++ b/src/libterm/terminfo/mod.rs @@ -78,7 +78,7 @@ impl<T: Writer+Send> Terminal<T> for TerminfoTerminal<T> { if self.num_colors > color { let s = expand(self.ti .strings - .find_equiv("setaf") + .get("setaf") .unwrap() .as_slice(), &[Number(color as int)], &mut Variables::new()); @@ -95,7 +95,7 @@ impl<T: Writer+Send> Terminal<T> for TerminfoTerminal<T> { if self.num_colors > color { let s = expand(self.ti .strings - .find_equiv("setab") + .get("setab") .unwrap() .as_slice(), &[Number(color as int)], &mut Variables::new()); @@ -113,7 +113,7 @@ impl<T: Writer+Send> Terminal<T> for TerminfoTerminal<T> { attr::BackgroundColor(c) => self.bg(c), _ => { let cap = cap_for_attr(attr); - let parm = self.ti.strings.find_equiv(cap); + let parm = self.ti.strings.get(cap); if parm.is_some() { let s = expand(parm.unwrap().as_slice(), &[], @@ -135,19 +135,19 @@ impl<T: Writer+Send> Terminal<T> for TerminfoTerminal<T> { } _ => { let cap = cap_for_attr(attr); - self.ti.strings.find_equiv(cap).is_some() + self.ti.strings.get(cap).is_some() } } } fn reset(&mut self) -> IoResult<()> { - let mut cap = self.ti.strings.find_equiv("sgr0"); + let mut cap = self.ti.strings.get("sgr0"); if cap.is_none() { // are there any terminals that have color/attrs and not sgr0? // Try falling back to sgr, then op - cap = self.ti.strings.find_equiv("sgr"); + cap = self.ti.strings.get("sgr"); if cap.is_none() { - cap = self.ti.strings.find_equiv("op"); + cap = self.ti.strings.get("op"); } } let s = cap.map_or(Err("can't find terminfo capability `sgr0`".to_string()), |op| { @@ -202,9 +202,9 @@ impl<T: Writer+Send> TerminfoTerminal<T> { } let inf = ti.unwrap(); - let nc = if inf.strings.find_equiv("setaf").is_some() - && inf.strings.find_equiv("setab").is_some() { - inf.numbers.find_equiv("colors").map_or(0, |&n| n) + let nc = if inf.strings.get("setaf").is_some() + && inf.strings.get("setab").is_some() { + inf.numbers.get("colors").map_or(0, |&n| n) } else { 0 }; return Some(box TerminfoTerminal {out: out, |
