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