Fix latest clippy lints
This commit is contained in:
parent
7420ea7a6b
commit
3e82ab069e
3 changed files with 16 additions and 18 deletions
|
|
@ -9,5 +9,5 @@ pub struct Cache<'a, Message: 'a, Renderer: 'a> {
|
||||||
|
|
||||||
#[borrows(mut element)]
|
#[borrows(mut element)]
|
||||||
#[covariant]
|
#[covariant]
|
||||||
pub overlay: Option<overlay::Element<'this, Message, Renderer>>,
|
overlay: Option<overlay::Element<'this, Message, Renderer>>,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -543,9 +543,11 @@ pub fn draw<T, Renderer>(
|
||||||
content: label,
|
content: label,
|
||||||
size: text_size,
|
size: text_size,
|
||||||
font: font.clone(),
|
font: font.clone(),
|
||||||
color: is_selected
|
color: if is_selected {
|
||||||
.then(|| style.text_color)
|
style.text_color
|
||||||
.unwrap_or(style.placeholder_color),
|
} else {
|
||||||
|
style.placeholder_color
|
||||||
|
},
|
||||||
bounds: Rectangle {
|
bounds: Rectangle {
|
||||||
x: bounds.x + f32::from(padding.left),
|
x: bounds.x + f32::from(padding.left),
|
||||||
y: bounds.center_y() - text_size / 2.0,
|
y: bounds.center_y() - text_size / 2.0,
|
||||||
|
|
|
||||||
|
|
@ -615,25 +615,21 @@ where
|
||||||
keyboard::KeyCode::C
|
keyboard::KeyCode::C
|
||||||
if state.keyboard_modifiers.command() =>
|
if state.keyboard_modifiers.command() =>
|
||||||
{
|
{
|
||||||
match state.cursor.selection(value) {
|
if let Some((start, end)) =
|
||||||
Some((start, end)) => {
|
state.cursor.selection(value)
|
||||||
clipboard.write(
|
{
|
||||||
value.select(start, end).to_string(),
|
clipboard
|
||||||
);
|
.write(value.select(start, end).to_string());
|
||||||
}
|
|
||||||
None => {}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
keyboard::KeyCode::X
|
keyboard::KeyCode::X
|
||||||
if state.keyboard_modifiers.command() =>
|
if state.keyboard_modifiers.command() =>
|
||||||
{
|
{
|
||||||
match state.cursor.selection(value) {
|
if let Some((start, end)) =
|
||||||
Some((start, end)) => {
|
state.cursor.selection(value)
|
||||||
clipboard.write(
|
{
|
||||||
value.select(start, end).to_string(),
|
clipboard
|
||||||
);
|
.write(value.select(start, end).to_string());
|
||||||
}
|
|
||||||
None => {}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut editor = Editor::new(value, &mut state.cursor);
|
let mut editor = Editor::new(value, &mut state.cursor);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue