@@ -173,7 +173,7 @@ macro_rules! static_commands {
173173impl MappableCommand {
174174 pub fn execute(&self, cx: &mut Context) {
175175 match &self {
176− MappableCommand::Typable { name, args, doc: _ } => {
176+ Self::Typable { name, args, doc: _ } => {
177177 let args: Vec<Cow<str>> = args.iter().map(Cow::from).collect();
178178 if let Some(command) = cmd::TYPABLE_COMMAND_MAP.get(name.as_str()) {
179179 let mut cx = compositor::Context {
@@ -186,21 +186,21 @@ impl MappableCommand {
186186 }
187187 }
188188 }
189− MappableCommand::Static { fun, .. } => (fun)(cx),
189+ Self::Static { fun, .. } => (fun)(cx),
190190 }
191191 }
192192
193193 pub fn name(&self) -> &str {
194194 match &self {
195− MappableCommand::Typable { name, .. } => name,
196− MappableCommand::Static { name, .. } => name,
195+ Self::Typable { name, .. } => name,
196+ Self::Static { name, .. } => name,
197197 }
198198 }
199199
200200 pub fn doc(&self) -> &str {
201201 match &self {
202− MappableCommand::Typable { doc, .. } => doc,
203− MappableCommand::Static { doc, .. } => doc,
202+ Self::Typable { doc, .. } => doc,
203+ Self::Static { doc, .. } => doc,
204204 }
205205 }
206206
@@ -3494,11 +3494,9 @@ pub fn apply_document_resource_op(op: &lsp::ResourceOp) -> std::io::Result<()> {
34943494 match op {
34953495 ResourceOp::Create(op) => {
34963496 let path = op.uri.to_file_path().unwrap();
3497− let ignore_if_exists = if let Some(options) = &op.options {
3497+ let ignore_if_exists = op.options.as_ref().map_or(false, |options| {
34983498 !options.overwrite.unwrap_or(false) && options.ignore_if_exists.unwrap_or(false)
3499− } else {
3500− false
3501− };
3499+ });
35023500 if ignore_if_exists && path.exists() {
35033501 Ok(())
35043502 } else {
@@ -3508,11 +3506,12 @@ pub fn apply_document_resource_op(op: &lsp::ResourceOp) -> std::io::Result<()> {
35083506 ResourceOp::Delete(op) => {
35093507 let path = op.uri.to_file_path().unwrap();
35103508 if path.is_dir() {
3511− let recursive = if let Some(options) = &op.options {
3512− options.recursive.unwrap_or(false)
3513− } else {
3514− false
3515− };
3509+ let recursive = op
3510+ .options
3511+ .as_ref()
3512+ .and_then(|options| options.recursive)
3513+ .unwrap_or(false);
3514+
35163515 if recursive {
35173516 fs::remove_dir_all(&path)
35183517 } else {
@@ -3527,11 +3526,9 @@ pub fn apply_document_resource_op(op: &lsp::ResourceOp) -> std::io::Result<()> {
35273526 ResourceOp::Rename(op) => {
35283527 let from = op.old_uri.to_file_path().unwrap();
35293528 let to = op.new_uri.to_file_path().unwrap();
3530− let ignore_if_exists = if let Some(options) = &op.options {
3529+ let ignore_if_exists = op.options.as_ref().map_or(false, |options| {
35313530 !options.overwrite.unwrap_or(false) && options.ignore_if_exists.unwrap_or(false)
3532− } else {
3533− false
3534− };
3531+ });
35353532 if ignore_if_exists && to.exists() {
35363533 Ok(())
35373534 } else {