Fix clippy lints for Rust 1.87
This commit is contained in:
parent
204c4773d5
commit
9a7ea88d55
5 changed files with 11 additions and 20 deletions
|
|
@ -220,6 +220,8 @@ unused_results = "deny"
|
|||
[workspace.lints.clippy]
|
||||
type-complexity = "allow"
|
||||
map-entry = "allow"
|
||||
large-enum-variant = "allow"
|
||||
result_large_err = "allow"
|
||||
semicolon_if_nothing_returned = "deny"
|
||||
trivially-copy-pass-by-ref = "deny"
|
||||
default_trait_access = "deny"
|
||||
|
|
|
|||
|
|
@ -298,13 +298,11 @@ impl Span {
|
|||
span
|
||||
};
|
||||
|
||||
let span = if let Some(link) = link.as_ref() {
|
||||
if let Some(link) = link.as_ref() {
|
||||
span.color(style.link_color).link(link.clone())
|
||||
} else {
|
||||
span
|
||||
};
|
||||
|
||||
span
|
||||
}
|
||||
}
|
||||
#[cfg(feature = "highlighter")]
|
||||
Span::Highlight { text, color, font } => {
|
||||
|
|
@ -632,7 +630,7 @@ fn parse_with<'a>(
|
|||
code_language =
|
||||
(!language.is_empty()).then(|| language.into_string());
|
||||
|
||||
let prev = if spans.is_empty() {
|
||||
if spans.is_empty() {
|
||||
None
|
||||
} else {
|
||||
produce(
|
||||
|
|
@ -641,9 +639,7 @@ fn parse_with<'a>(
|
|||
Item::Paragraph(Text::new(spans.drain(..).collect())),
|
||||
source,
|
||||
)
|
||||
};
|
||||
|
||||
prev
|
||||
}
|
||||
}
|
||||
pulldown_cmark::Tag::MetadataBlock(_) => {
|
||||
metadata = true;
|
||||
|
|
|
|||
|
|
@ -261,7 +261,7 @@ where
|
|||
let locate = |cursor_position: Point| -> Option<T> {
|
||||
let bounds = layout.bounds();
|
||||
|
||||
let new_value = if cursor_position.x <= bounds.x {
|
||||
if cursor_position.x <= bounds.x {
|
||||
Some(*self.range.start())
|
||||
} else if cursor_position.x >= bounds.x + bounds.width {
|
||||
Some(*self.range.end())
|
||||
|
|
@ -283,9 +283,7 @@ where
|
|||
let value = steps * step + start;
|
||||
|
||||
T::from_f64(value.min(end))
|
||||
};
|
||||
|
||||
new_value
|
||||
}
|
||||
};
|
||||
|
||||
let increment = |value: T| -> Option<T> {
|
||||
|
|
|
|||
|
|
@ -173,10 +173,7 @@ where
|
|||
let nodes = std::iter::once(base)
|
||||
.chain(self.children[1..].iter().zip(&mut tree.children[1..]).map(
|
||||
|(layer, tree)| {
|
||||
let node =
|
||||
layer.as_widget().layout(tree, renderer, &limits);
|
||||
|
||||
node
|
||||
layer.as_widget().layout(tree, renderer, &limits)
|
||||
},
|
||||
))
|
||||
.collect();
|
||||
|
|
|
|||
|
|
@ -264,7 +264,7 @@ where
|
|||
let locate = |cursor_position: Point| -> Option<T> {
|
||||
let bounds = layout.bounds();
|
||||
|
||||
let new_value = if cursor_position.y >= bounds.y + bounds.height {
|
||||
if cursor_position.y >= bounds.y + bounds.height {
|
||||
Some(*self.range.start())
|
||||
} else if cursor_position.y <= bounds.y {
|
||||
Some(*self.range.end())
|
||||
|
|
@ -287,9 +287,7 @@ where
|
|||
let value = steps * step + start;
|
||||
|
||||
T::from_f64(value.min(end))
|
||||
};
|
||||
|
||||
new_value
|
||||
}
|
||||
};
|
||||
|
||||
let increment = |value: T| -> Option<T> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue