diff --git a/src/buffer.rs b/src/buffer.rs index f004cf3..721ffa7 100644 --- a/src/buffer.rs +++ b/src/buffer.rs @@ -195,7 +195,7 @@ impl StackFrame { .drawable_area .and_then(|(da_pos, da_size)| Self::intersect_areas(da_pos, da_size, pos, size)); - StackFrame { + Self { pos, size, drawable_area, diff --git a/src/lib.rs b/src/lib.rs index 0afea1c..9a03207 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,3 +1,14 @@ +#![forbid(unsafe_code)] +// Rustc lint groups +#![warn(future_incompatible)] +#![warn(rust_2018_idioms)] +#![warn(unused)] +// Rustc lints +#![warn(noop_method_call)] +#![warn(single_use_lifetimes)] +// Clippy lints +#![warn(clippy::use_self)] + mod buffer; pub mod frame; pub mod styled; diff --git a/src/styled.rs b/src/styled.rs index 9871aab..99b346d 100644 --- a/src/styled.rs +++ b/src/styled.rs @@ -34,7 +34,7 @@ impl Styled { self.then(text, ContentStyle::default()) } - pub fn and_then(mut self, mut other: Styled) -> Self { + pub fn and_then(mut self, mut other: Self) -> Self { let delta = self.text.len(); for (_, until) in &mut other.styles { *until += delta;