refactor(lint): specify must_use more often

This commit is contained in:
EdJoPaTo
2022-02-26 13:56:34 +01:00
parent 07a5e90158
commit d228f439f1
+6
View File
@@ -124,6 +124,7 @@ impl<'a> TreeItem<'a> {
self.text.height() self.text.height()
} }
#[must_use]
pub const fn style(mut self, style: Style) -> Self { pub const fn style(mut self, style: Style) -> Self {
self.style = style; self.style = style;
self self
@@ -163,26 +164,31 @@ impl<'a> Tree<'a> {
} }
#[allow(clippy::missing_const_for_fn)] #[allow(clippy::missing_const_for_fn)]
#[must_use]
pub fn block(mut self, block: Block<'a>) -> Self { pub fn block(mut self, block: Block<'a>) -> Self {
self.block = Some(block); self.block = Some(block);
self self
} }
#[must_use]
pub const fn style(mut self, style: Style) -> Self { pub const fn style(mut self, style: Style) -> Self {
self.style = style; self.style = style;
self self
} }
#[must_use]
pub const fn highlight_symbol(mut self, highlight_symbol: &'a str) -> Self { pub const fn highlight_symbol(mut self, highlight_symbol: &'a str) -> Self {
self.highlight_symbol = Some(highlight_symbol); self.highlight_symbol = Some(highlight_symbol);
self self
} }
#[must_use]
pub const fn highlight_style(mut self, style: Style) -> Self { pub const fn highlight_style(mut self, style: Style) -> Self {
self.highlight_style = style; self.highlight_style = style;
self self
} }
#[must_use]
pub const fn start_corner(mut self, corner: Corner) -> Self { pub const fn start_corner(mut self, corner: Corner) -> Self {
self.start_corner = corner; self.start_corner = corner;
self self