Skip to content

Commit c6040da

Browse files
jplattemaan2003
authored andcommitted
clippy: Remove redundant clones
1 parent 51c49fe commit c6040da

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

druid/examples/value_formatting/src/widgets.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ impl<W: Widget<AppData>> Controller<AppData, W> for RootController {
193193
) {
194194
match event {
195195
Event::Command(cmd) if cmd.is(EDIT_BEGAN) => {
196-
let widget_id = cmd.get_unchecked(EDIT_BEGAN).clone();
196+
let widget_id = *cmd.get_unchecked(EDIT_BEGAN);
197197
data.active_message = match widget_id {
198198
DOLLAR_ERROR_WIDGET => Some(DOLLAR_EXPLAINER),
199199
EURO_ERROR_WIDGET => Some(EURO_EXPLAINER),
@@ -205,7 +205,7 @@ impl<W: Widget<AppData>> Controller<AppData, W> for RootController {
205205
data.active_textbox = Some(widget_id);
206206
}
207207
Event::Command(cmd) if cmd.is(EDIT_FINISHED) => {
208-
let finished_id = cmd.get_unchecked(EDIT_FINISHED).clone();
208+
let finished_id = *cmd.get_unchecked(EDIT_FINISHED);
209209
if data.active_textbox == Some(finished_id) {
210210
data.active_textbox = None;
211211
data.active_message = None;
@@ -241,10 +241,10 @@ impl ValidationDelegate for TextBoxErrorDelegate {
241241
ctx.submit_command(CLEAR_ERROR.to(self.target));
242242
}
243243
TextBoxEvent::PartiallyInvalid(err) if self.sends_partial_errors => {
244-
ctx.submit_command(SHOW_ERROR.with(err.to_owned()).to(self.target));
244+
ctx.submit_command(SHOW_ERROR.with(err).to(self.target));
245245
}
246246
TextBoxEvent::Invalid(err) => {
247-
ctx.submit_command(SHOW_ERROR.with(err.to_owned()).to(self.target));
247+
ctx.submit_command(SHOW_ERROR.with(err).to(self.target));
248248
}
249249
TextBoxEvent::Cancel | TextBoxEvent::Complete => {
250250
ctx.submit_command(CLEAR_ERROR.to(self.target));

0 commit comments

Comments
 (0)