Merge pull request #1444 from iced-rs/fix/clippy-lints

Fix latest `clippy` lints
This commit is contained in:
Héctor Ramón 2022-09-23 18:04:16 +02:00 committed by GitHub
commit 489a85518b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 18 deletions

View file

@ -9,5 +9,5 @@ pub struct Cache<'a, Message: 'a, Renderer: 'a> {
#[borrows(mut element)]
#[covariant]
pub overlay: Option<overlay::Element<'this, Message, Renderer>>,
overlay: Option<overlay::Element<'this, Message, Renderer>>,
}

View file

@ -543,9 +543,11 @@ pub fn draw<T, Renderer>(
content: label,
size: text_size,
font: font.clone(),
color: is_selected
.then(|| style.text_color)
.unwrap_or(style.placeholder_color),
color: if is_selected {
style.text_color
} else {
style.placeholder_color
},
bounds: Rectangle {
x: bounds.x + f32::from(padding.left),
y: bounds.center_y() - text_size / 2.0,

View file

@ -615,25 +615,21 @@ where
keyboard::KeyCode::C
if state.keyboard_modifiers.command() =>
{
match state.cursor.selection(value) {
Some((start, end)) => {
clipboard.write(
value.select(start, end).to_string(),
);
}
None => {}
if let Some((start, end)) =
state.cursor.selection(value)
{
clipboard
.write(value.select(start, end).to_string());
}
}
keyboard::KeyCode::X
if state.keyboard_modifiers.command() =>
{
match state.cursor.selection(value) {
Some((start, end)) => {
clipboard.write(
value.select(start, end).to_string(),
);
}
None => {}
if let Some((start, end)) =
state.cursor.selection(value)
{
clipboard
.write(value.select(start, end).to_string());
}
let mut editor = Editor::new(value, &mut state.cursor);