chore: clippy + fmt
This commit is contained in:
@ -424,7 +424,9 @@ impl Cmd for EnterEditMode {
|
||||
name: "edit".to_string(),
|
||||
value: current,
|
||||
}),
|
||||
effect::change_mode(AppMode::Editing { buffer: String::new() }),
|
||||
effect::change_mode(AppMode::Editing {
|
||||
buffer: String::new(),
|
||||
}),
|
||||
]
|
||||
}
|
||||
}
|
||||
@ -1155,15 +1157,9 @@ impl Cmd for CommitCellEdit {
|
||||
if buf.is_empty() {
|
||||
effects.push(Box::new(effect::ClearCell(key)));
|
||||
} else if let Ok(n) = buf.parse::<f64>() {
|
||||
effects.push(Box::new(effect::SetCell(
|
||||
key,
|
||||
CellValue::Number(n),
|
||||
)));
|
||||
effects.push(Box::new(effect::SetCell(key, CellValue::Number(n))));
|
||||
} else {
|
||||
effects.push(Box::new(effect::SetCell(
|
||||
key,
|
||||
CellValue::Text(buf),
|
||||
)));
|
||||
effects.push(Box::new(effect::SetCell(key, CellValue::Text(buf))));
|
||||
}
|
||||
effects.push(effect::mark_dirty());
|
||||
}
|
||||
@ -1184,7 +1180,12 @@ impl Cmd for CommitFormula {
|
||||
}
|
||||
fn execute(&self, ctx: &CmdContext) -> Vec<Box<dyn Effect>> {
|
||||
let buf = ctx.buffers.get("formula").cloned().unwrap_or_default();
|
||||
let first_cat = ctx.model.category_names().into_iter().next().map(String::from);
|
||||
let first_cat = ctx
|
||||
.model
|
||||
.category_names()
|
||||
.into_iter()
|
||||
.next()
|
||||
.map(String::from);
|
||||
let mut effects: Vec<Box<dyn Effect>> = Vec::new();
|
||||
if let Some(cat) = first_cat {
|
||||
effects.push(Box::new(effect::AddFormula {
|
||||
|
||||
Reference in New Issue
Block a user