Auto merge of #31014 - nrc:fmt-term, r=sfackler
This commit is contained in:
commit
f6dd66e568
@ -74,9 +74,9 @@ pub mod terminfo;
|
||||
mod win;
|
||||
|
||||
/// Alias for stdout terminals.
|
||||
pub type StdoutTerminal = Terminal<Output=Stdout> + Send;
|
||||
pub type StdoutTerminal = Terminal<Output = Stdout> + Send;
|
||||
/// Alias for stderr terminals.
|
||||
pub type StderrTerminal = Terminal<Output=Stderr> + Send;
|
||||
pub type StderrTerminal = Terminal<Output = Stderr> + Send;
|
||||
|
||||
#[cfg(not(windows))]
|
||||
/// Return a Terminal wrapping stdout, or None if a terminal couldn't be
|
||||
|
@ -151,7 +151,7 @@ pub struct TerminfoTerminal<T> {
|
||||
ti: TermInfo,
|
||||
}
|
||||
|
||||
impl<T: Write+Send> Terminal for TerminfoTerminal<T> {
|
||||
impl<T: Write + Send> Terminal for TerminfoTerminal<T> {
|
||||
type Output = T;
|
||||
fn fg(&mut self, color: color::Color) -> io::Result<bool> {
|
||||
let color = self.dim_if_necessary(color);
|
||||
@ -220,7 +220,7 @@ impl<T: Write+Send> Terminal for TerminfoTerminal<T> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: Write+Send> TerminfoTerminal<T> {
|
||||
impl<T: Write + Send> TerminfoTerminal<T> {
|
||||
/// Create a new TerminfoTerminal with the given TermInfo and Write.
|
||||
pub fn new_with_terminfo(out: T, terminfo: TermInfo) -> TerminfoTerminal<T> {
|
||||
let nc = if terminfo.strings.contains_key("setaf") &&
|
||||
|
@ -91,7 +91,7 @@ fn bits_to_color(bits: u16) -> color::Color {
|
||||
color | (bits & 0x8) // copy the hi-intensity bit
|
||||
}
|
||||
|
||||
impl<T: Write+Send+'static> WinConsole<T> {
|
||||
impl<T: Write + Send + 'static> WinConsole<T> {
|
||||
fn apply(&mut self) {
|
||||
let _unused = self.buf.flush();
|
||||
let mut accum: WORD = 0;
|
||||
@ -148,7 +148,7 @@ impl<T: Write> Write for WinConsole<T> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: Write+Send+'static> Terminal for WinConsole<T> {
|
||||
impl<T: Write + Send + 'static> Terminal for WinConsole<T> {
|
||||
type Output = T;
|
||||
|
||||
fn fg(&mut self, color: color::Color) -> io::Result<bool> {
|
||||
|
Loading…
Reference in New Issue
Block a user