Skip to content
This repository was archived by the owner on Aug 12, 2021. It is now read-only.

Commit e62131c

Browse files
author
Alexander Regueiro
committed
rustc: doc comments
1 parent f92c36c commit e62131c

File tree

6 files changed

+15
-16
lines changed

6 files changed

+15
-16
lines changed

lib.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,14 @@ pub type StdoutTerminal = dyn Terminal<Output = Stdout> + Send;
6060
pub type StderrTerminal = dyn Terminal<Output = Stderr> + Send;
6161

6262
#[cfg(not(windows))]
63-
/// Return a Terminal wrapping stdout, or None if a terminal couldn't be
63+
/// Returns a Terminal wrapping stdout, or None if a terminal couldn't be
6464
/// opened.
6565
pub fn stdout() -> Option<Box<StdoutTerminal>> {
6666
TerminfoTerminal::new(io::stdout()).map(|t| Box::new(t) as Box<StdoutTerminal>)
6767
}
6868

6969
#[cfg(windows)]
70-
/// Return a Terminal wrapping stdout, or None if a terminal couldn't be
70+
/// Returns a Terminal wrapping stdout, or None if a terminal couldn't be
7171
/// opened.
7272
pub fn stdout() -> Option<Box<StdoutTerminal>> {
7373
TerminfoTerminal::new(io::stdout())
@@ -76,14 +76,14 @@ pub fn stdout() -> Option<Box<StdoutTerminal>> {
7676
}
7777

7878
#[cfg(not(windows))]
79-
/// Return a Terminal wrapping stderr, or None if a terminal couldn't be
79+
/// Returns a Terminal wrapping stderr, or None if a terminal couldn't be
8080
/// opened.
8181
pub fn stderr() -> Option<Box<StderrTerminal>> {
8282
TerminfoTerminal::new(io::stderr()).map(|t| Box::new(t) as Box<StderrTerminal>)
8383
}
8484

8585
#[cfg(windows)]
86-
/// Return a Terminal wrapping stderr, or None if a terminal couldn't be
86+
/// Returns a Terminal wrapping stderr, or None if a terminal couldn't be
8787
/// opened.
8888
pub fn stderr() -> Option<Box<StderrTerminal>> {
8989
TerminfoTerminal::new(io::stderr())
@@ -170,12 +170,12 @@ pub trait Terminal: Write {
170170
/// if there was an I/O error.
171171
fn bg(&mut self, color: color::Color) -> io::Result<bool>;
172172

173-
/// Sets the given terminal attribute, if supported. Returns `Ok(true)`
173+
/// Sets the given terminal attribute, if supported. Returns `Ok(true)`
174174
/// if the attribute was supported, `Ok(false)` otherwise, and `Err(e)` if
175175
/// there was an I/O error.
176176
fn attr(&mut self, attr: Attr) -> io::Result<bool>;
177177

178-
/// Returns whether the given terminal attribute is supported.
178+
/// Returns `true` if the given terminal attribute is supported.
179179
fn supports_attr(&self, attr: Attr) -> bool;
180180

181181
/// Resets all terminal attributes and colors to their defaults.

terminfo/mod.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ impl fmt::Display for Error {
6969
}
7070

7171
impl TermInfo {
72-
/// Create a TermInfo based on current environment.
72+
/// Creates a TermInfo based on current environment.
7373
pub fn from_env() -> Result<TermInfo, Error> {
7474
let term = match env::var("TERM") {
7575
Ok(name) => TermInfo::from_name(&name),
@@ -84,7 +84,7 @@ impl TermInfo {
8484
}
8585
}
8686

87-
/// Create a TermInfo for the named terminal.
87+
/// Creates a TermInfo for the named terminal.
8888
pub fn from_name(name: &str) -> Result<TermInfo, Error> {
8989
get_dbpath_for_term(name)
9090
.ok_or_else(|| {
@@ -211,7 +211,7 @@ impl<T: Write + Send> Terminal for TerminfoTerminal<T> {
211211
}
212212

213213
impl<T: Write + Send> TerminfoTerminal<T> {
214-
/// Create a new TerminfoTerminal with the given TermInfo and Write.
214+
/// Creates a new TerminfoTerminal with the given TermInfo and Write.
215215
pub fn new_with_terminfo(out: T, terminfo: TermInfo) -> TerminfoTerminal<T> {
216216
let nc = if terminfo.strings.contains_key("setaf") &&
217217
terminfo.strings.contains_key("setab") {
@@ -227,7 +227,7 @@ impl<T: Write + Send> TerminfoTerminal<T> {
227227
}
228228
}
229229

230-
/// Create a new TerminfoTerminal for the current environment with the given Write.
230+
/// Creates a new TerminfoTerminal for the current environment with the given Write.
231231
///
232232
/// Returns `None` when the terminfo cannot be found or parsed.
233233
pub fn new(out: T) -> Option<TerminfoTerminal<T>> {

terminfo/parm.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ pub struct Variables {
4646
}
4747

4848
impl Variables {
49-
/// Return a new zero-initialized Variables
49+
/// Returns a new zero-initialized Variables
5050
pub fn new() -> Variables {
5151
Variables {
5252
sta: [Number(0), Number(0), Number(0), Number(0), Number(0), Number(0), Number(0),

terminfo/parser/compiled.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ pub fn parse(file: &mut dyn io::Read, longnames: bool) -> Result<TermInfo, Strin
313313
})
314314
}
315315

316-
/// Create a dummy TermInfo struct for msys terminals
316+
/// Creates a dummy TermInfo struct for msys terminals
317317
pub fn msys_terminfo() -> TermInfo {
318318
let mut strings = HashMap::new();
319319
strings.insert("sgr0".to_string(), b"\x1B[0m".to_vec());

terminfo/searcher.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! ncurses-compatible database discovery
1+
//! ncurses-compatible database discovery.
22
//!
33
//! Does not support hashed database, only filesystem!
44

win.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use Attr;
1111
use color;
1212
use Terminal;
1313

14-
/// A Terminal implementation which uses the Win32 Console API.
14+
/// A Terminal implementation that uses the Win32 Console API.
1515
pub struct WinConsole<T> {
1616
buf: T,
1717
def_foreground: color::Color,
@@ -103,8 +103,7 @@ impl<T: Write + Send + 'static> WinConsole<T> {
103103
}
104104
}
105105

106-
/// Returns `None` whenever the terminal cannot be created for some
107-
/// reason.
106+
/// Returns `None` whenever the terminal cannot be created for some reason.
108107
pub fn new(out: T) -> io::Result<WinConsole<T>> {
109108
let fg;
110109
let bg;

0 commit comments

Comments
 (0)