about summary refs log tree commit diff
path: root/src/libterm
diff options
context:
space:
mode:
authorAlexander Regueiro <alexreg@me.com>2019-02-08 14:53:55 +0100
committerAlexander Regueiro <alexreg@me.com>2019-02-10 23:42:32 +0000
commitc3e182cf43aea2c010a1915eb37293a458df2228 (patch)
tree225aa2dfceff56d10c0b31f6966fbf7ec5da8180 /src/libterm
parent0b7af2668a80fb2fa720a06ca44aff4dd1e9de38 (diff)
rustc: doc comments
Diffstat (limited to 'src/libterm')
-rw-r--r--src/libterm/lib.rs12
-rw-r--r--src/libterm/terminfo/mod.rs8
-rw-r--r--src/libterm/terminfo/parm.rs2
-rw-r--r--src/libterm/terminfo/parser/compiled.rs2
-rw-r--r--src/libterm/terminfo/searcher.rs2
-rw-r--r--src/libterm/win.rs5
6 files changed, 15 insertions, 16 deletions
diff --git a/src/libterm/lib.rs b/src/libterm/lib.rs
index 4d3126212dc..5132a459f95 100644
--- a/src/libterm/lib.rs
+++ b/src/libterm/lib.rs
@@ -60,14 +60,14 @@ pub type StdoutTerminal = dyn Terminal<Output = Stdout> + Send;
 pub type StderrTerminal = dyn Terminal<Output = Stderr> + Send;
 
 #[cfg(not(windows))]
-/// Return a Terminal wrapping stdout, or None if a terminal couldn't be
+/// Returns a Terminal wrapping stdout, or None if a terminal couldn't be
 /// opened.
 pub fn stdout() -> Option<Box<StdoutTerminal>> {
     TerminfoTerminal::new(io::stdout()).map(|t| Box::new(t) as Box<StdoutTerminal>)
 }
 
 #[cfg(windows)]
-/// Return a Terminal wrapping stdout, or None if a terminal couldn't be
+/// Returns a Terminal wrapping stdout, or None if a terminal couldn't be
 /// opened.
 pub fn stdout() -> Option<Box<StdoutTerminal>> {
     TerminfoTerminal::new(io::stdout())
@@ -76,14 +76,14 @@ pub fn stdout() -> Option<Box<StdoutTerminal>> {
 }
 
 #[cfg(not(windows))]
-/// Return a Terminal wrapping stderr, or None if a terminal couldn't be
+/// Returns a Terminal wrapping stderr, or None if a terminal couldn't be
 /// opened.
 pub fn stderr() -> Option<Box<StderrTerminal>> {
     TerminfoTerminal::new(io::stderr()).map(|t| Box::new(t) as Box<StderrTerminal>)
 }
 
 #[cfg(windows)]
-/// Return a Terminal wrapping stderr, or None if a terminal couldn't be
+/// Returns a Terminal wrapping stderr, or None if a terminal couldn't be
 /// opened.
 pub fn stderr() -> Option<Box<StderrTerminal>> {
     TerminfoTerminal::new(io::stderr())
@@ -170,12 +170,12 @@ pub trait Terminal: Write {
     /// if there was an I/O error.
     fn bg(&mut self, color: color::Color) -> io::Result<bool>;
 
-    /// Sets the given terminal attribute, if supported.  Returns `Ok(true)`
+    /// Sets the given terminal attribute, if supported. Returns `Ok(true)`
     /// if the attribute was supported, `Ok(false)` otherwise, and `Err(e)` if
     /// there was an I/O error.
     fn attr(&mut self, attr: Attr) -> io::Result<bool>;
 
-    /// Returns whether the given terminal attribute is supported.
+    /// Returns `true` if the given terminal attribute is supported.
     fn supports_attr(&self, attr: Attr) -> bool;
 
     /// Resets all terminal attributes and colors to their defaults.
diff --git a/src/libterm/terminfo/mod.rs b/src/libterm/terminfo/mod.rs
index eaa96df3f3b..0dbaa3d3dfd 100644
--- a/src/libterm/terminfo/mod.rs
+++ b/src/libterm/terminfo/mod.rs
@@ -69,7 +69,7 @@ impl fmt::Display for Error {
 }
 
 impl TermInfo {
-    /// Create a TermInfo based on current environment.
+    /// Creates a TermInfo based on current environment.
     pub fn from_env() -> Result<TermInfo, Error> {
         let term = match env::var("TERM") {
             Ok(name) => TermInfo::from_name(&name),
@@ -84,7 +84,7 @@ impl TermInfo {
         }
     }
 
-    /// Create a TermInfo for the named terminal.
+    /// Creates a TermInfo for the named terminal.
     pub fn from_name(name: &str) -> Result<TermInfo, Error> {
         get_dbpath_for_term(name)
             .ok_or_else(|| {
@@ -211,7 +211,7 @@ impl<T: Write + Send> Terminal for TerminfoTerminal<T> {
 }
 
 impl<T: Write + Send> TerminfoTerminal<T> {
-    /// Create a new TerminfoTerminal with the given TermInfo and Write.
+    /// Creates 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") &&
                     terminfo.strings.contains_key("setab") {
@@ -227,7 +227,7 @@ impl<T: Write + Send> TerminfoTerminal<T> {
         }
     }
 
-    /// Create a new TerminfoTerminal for the current environment with the given Write.
+    /// Creates a new TerminfoTerminal for the current environment with the given Write.
     ///
     /// Returns `None` when the terminfo cannot be found or parsed.
     pub fn new(out: T) -> Option<TerminfoTerminal<T>> {
diff --git a/src/libterm/terminfo/parm.rs b/src/libterm/terminfo/parm.rs
index 434dd4a9fbc..e55307dcdf0 100644
--- a/src/libterm/terminfo/parm.rs
+++ b/src/libterm/terminfo/parm.rs
@@ -46,7 +46,7 @@ pub struct Variables {
 }
 
 impl Variables {
-    /// Return a new zero-initialized Variables
+    /// Returns a new zero-initialized Variables
     pub fn new() -> Variables {
         Variables {
             sta: [Number(0), Number(0), Number(0), Number(0), Number(0), Number(0), Number(0),
diff --git a/src/libterm/terminfo/parser/compiled.rs b/src/libterm/terminfo/parser/compiled.rs
index 63d01831269..47124f5df69 100644
--- a/src/libterm/terminfo/parser/compiled.rs
+++ b/src/libterm/terminfo/parser/compiled.rs
@@ -313,7 +313,7 @@ pub fn parse(file: &mut dyn io::Read, longnames: bool) -> Result<TermInfo, Strin
     })
 }
 
-/// Create a dummy TermInfo struct for msys terminals
+/// Creates a dummy TermInfo struct for msys terminals
 pub fn msys_terminfo() -> TermInfo {
     let mut strings = HashMap::new();
     strings.insert("sgr0".to_string(), b"\x1B[0m".to_vec());
diff --git a/src/libterm/terminfo/searcher.rs b/src/libterm/terminfo/searcher.rs
index a9e2626a57e..0b17ed36fc8 100644
--- a/src/libterm/terminfo/searcher.rs
+++ b/src/libterm/terminfo/searcher.rs
@@ -1,4 +1,4 @@
-//! ncurses-compatible database discovery
+//! ncurses-compatible database discovery.
 //!
 //! Does not support hashed database, only filesystem!
 
diff --git a/src/libterm/win.rs b/src/libterm/win.rs
index 25b03ba59ac..a09a5f6da21 100644
--- a/src/libterm/win.rs
+++ b/src/libterm/win.rs
@@ -11,7 +11,7 @@ use Attr;
 use color;
 use Terminal;
 
-/// A Terminal implementation which uses the Win32 Console API.
+/// A Terminal implementation that uses the Win32 Console API.
 pub struct WinConsole<T> {
     buf: T,
     def_foreground: color::Color,
@@ -103,8 +103,7 @@ impl<T: Write + Send + 'static> WinConsole<T> {
         }
     }
 
-    /// Returns `None` whenever the terminal cannot be created for some
-    /// reason.
+    /// Returns `None` whenever the terminal cannot be created for some reason.
     pub fn new(out: T) -> io::Result<WinConsole<T>> {
         let fg;
         let bg;