diff options
author | Jesse Luehrs <doy@tozt.net> | 2020-02-09 13:08:11 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2020-02-09 13:08:11 -0500 |
commit | 26bc383f15fae383580e3faac1c0800a8dc17f99 (patch) | |
tree | dec6ff026cd7da3f467dc24bcb96ff5673472d35 /src/cell.rs | |
parent | 1cc79222c23fc624cfa53e2ada0b61aad618b9d9 (diff) | |
download | vt100-rust-26bc383f15fae383580e3faac1c0800a8dc17f99.tar.gz vt100-rust-26bc383f15fae383580e3faac1c0800a8dc17f99.zip |
clippy
Diffstat (limited to 'src/cell.rs')
-rw-r--r-- | src/cell.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/cell.rs b/src/cell.rs index 95d047e..e1e3a5b 100644 --- a/src/cell.rs +++ b/src/cell.rs @@ -63,6 +63,7 @@ impl Cell { /// Can include multiple unicode characters if combining characters are /// used, but will contain at most one character with a non-zero character /// width. + #[must_use] pub fn contents(&self) -> String { let mut s = String::with_capacity(CODEPOINTS_IN_CELL * 4); for c in self.contents.iter().take(self.len()) { @@ -72,15 +73,18 @@ impl Cell { } /// Returns whether the cell contains any text data. + #[must_use] pub fn has_contents(&self) -> bool { self.len > 0 } /// Returns whether the text data in the cell represents a wide character. + #[must_use] pub fn is_wide(&self) -> bool { self.len & 0x80 == 0x80 } + #[must_use] pub fn is_wide_continuation(&self) -> bool { self.len & 0x40 == 0x40 } @@ -106,35 +110,41 @@ impl Cell { } /// Returns the foreground color of the cell. + #[must_use] pub fn fgcolor(&self) -> crate::attrs::Color { self.attrs.fgcolor } /// Returns the background color of the cell. + #[must_use] pub fn bgcolor(&self) -> crate::attrs::Color { self.attrs.bgcolor } /// Returns whether the cell should be rendered with the bold text /// attribute. + #[must_use] pub fn bold(&self) -> bool { self.attrs.bold() } /// Returns whether the cell should be rendered with the italic text /// attribute. + #[must_use] pub fn italic(&self) -> bool { self.attrs.italic() } /// Returns whether the cell should be rendered with the underlined text /// attribute. + #[must_use] pub fn underline(&self) -> bool { self.attrs.underline() } /// Returns whether the cell should be rendered with the inverse text /// attribute. + #[must_use] pub fn inverse(&self) -> bool { self.attrs.inverse() } |