diff --git a/plugins/fs/src/watcher.rs b/plugins/fs/src/watcher.rs index 69f12e42..89446b88 100644 --- a/plugins/fs/src/watcher.rs +++ b/plugins/fs/src/watcher.rs @@ -45,16 +45,18 @@ pub fn watch( global_scope: GlobalScope, command_scope: CommandScope, ) -> CommandResult { - let mut resolved_paths = Vec::with_capacity(paths.capacity()); - for path in paths { - resolved_paths.push(resolve_path( - &webview, - &global_scope, - &command_scope, - path, - options.base_dir, - )?); - } + let resolved_paths = paths + .into_iter() + .map(|path| { + resolve_path( + &webview, + &global_scope, + &command_scope, + path, + options.base_dir, + ) + }) + .collect::>>()?; let recursive_mode = if options.recursive { RecursiveMode::Recursive