"semver 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"tar 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"tempdir 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
- "term 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)",
+ "term 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"time 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)",
"toml 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)",
"url 0.2.38 (registry+https://github.com/rust-lang/crates.io-index)",
[[package]]
name = "term"
-version = "0.2.14"
+version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"kernel32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
use std::io;
use term::color::{Color, BLACK, RED, GREEN, YELLOW};
-use term::{Terminal, TerminfoTerminal, color, Attr};
+use term::{self, Terminal, TerminfoTerminal, color, Attr};
use self::AdequateTerminal::{NoColor, Colored};
use self::Verbosity::{Verbose, Normal, Quiet};
Ok(())
}
- fn fg(&mut self, color: color::Color) -> io::Result<bool> {
+ fn fg(&mut self, color: color::Color) -> CargoResult<bool> {
let colored = self.colored();
match self.terminal {
- Colored(ref mut c) if colored => c.fg(color),
- _ => Ok(false),
+ Colored(ref mut c) if colored => try!(c.fg(color)),
+ _ => return Ok(false),
}
+ Ok(true)
}
- fn attr(&mut self, attr: Attr) -> io::Result<bool> {
+ fn attr(&mut self, attr: Attr) -> CargoResult<bool> {
let colored = self.colored();
match self.terminal {
- Colored(ref mut c) if colored => c.attr(attr),
- _ => Ok(false)
+ Colored(ref mut c) if colored => try!(c.attr(attr)),
+ _ => return Ok(false)
}
+ Ok(true)
}
fn supports_attr(&self, attr: Attr) -> bool {
}
}
- fn reset(&mut self) -> io::Result<()> {
+ fn reset(&mut self) -> term::Result<()> {
let colored = self.colored();
match self.terminal {
- Colored(ref mut c) if colored => c.reset().map(|_| ()),
- _ => Ok(())
+ Colored(ref mut c) if colored => try!(c.reset()),
+ _ => ()
}
+ Ok(())
}
fn colored(&self) -> bool {
use git2;
use rustc_serialize::json;
use semver;
+use term;
use toml;
use url;
url::ParseError,
toml::DecodeError,
ffi::NulError,
+ term::Error,
}
impl<E: CargoError> From<Human<E>> for Box<CargoError> {
impl CargoError for toml::DecodeError {}
impl CargoError for url::ParseError {}
impl CargoError for ffi::NulError {}
+impl CargoError for term::Error {}
// =============================================================================
// Construction helpers