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

Commit e1f6e98

Browse files
committed
Auto merge of #58341 - alexreg:cosmetic-2-doc-comments, r=steveklabnik
Cosmetic improvements to doc comments This has been factored out from rust-lang/rust#58036 to only include changes to documentation comments (throughout the rustc codebase). r? @steveklabnik Once you're happy with this, maybe we could get it through with r=1, so it doesn't constantly get invalidated? (I'm not sure this will be an issue, but just in case...) Anyway, thanks for your advice so far!
2 parents 0295573 + e62131c commit e1f6e98

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
@@ -67,7 +67,7 @@ impl fmt::Display for Error {
6767
}
6868

6969
impl TermInfo {
70-
/// Create a TermInfo based on current environment.
70+
/// Creates a TermInfo based on current environment.
7171
pub fn from_env() -> Result<TermInfo, Error> {
7272
let term = match env::var("TERM") {
7373
Ok(name) => TermInfo::from_name(&name),
@@ -82,7 +82,7 @@ impl TermInfo {
8282
}
8383
}
8484

85-
/// Create a TermInfo for the named terminal.
85+
/// Creates a TermInfo for the named terminal.
8686
pub fn from_name(name: &str) -> Result<TermInfo, Error> {
8787
get_dbpath_for_term(name)
8888
.ok_or_else(|| {
@@ -209,7 +209,7 @@ impl<T: Write + Send> Terminal for TerminfoTerminal<T> {
209209
}
210210

211211
impl<T: Write + Send> TerminfoTerminal<T> {
212-
/// Create a new TerminfoTerminal with the given TermInfo and Write.
212+
/// Creates a new TerminfoTerminal with the given TermInfo and Write.
213213
pub fn new_with_terminfo(out: T, terminfo: TermInfo) -> TerminfoTerminal<T> {
214214
let nc = if terminfo.strings.contains_key("setaf") &&
215215
terminfo.strings.contains_key("setab") {
@@ -225,7 +225,7 @@ impl<T: Write + Send> TerminfoTerminal<T> {
225225
}
226226
}
227227

228-
/// Create a new TerminfoTerminal for the current environment with the given Write.
228+
/// Creates a new TerminfoTerminal for the current environment with the given Write.
229229
///
230230
/// Returns `None` when the terminfo cannot be found or parsed.
231231
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_va: [

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 crate::Attr;
1111
use crate::color;
1212
use crate::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)