Add and fix some lints

This commit is contained in:
Joscha 2022-12-11 20:44:06 +01:00
parent 06aefd562b
commit 8942b381f5
3 changed files with 13 additions and 2 deletions

View file

@ -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,

View file

@ -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;

View file

@ -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;