Use map instead of mut Vec

pull/2613/head
Tony 3 months ago
parent 81def417cd
commit a425b5f625
No known key found for this signature in database
GPG Key ID: 34BDD3EA27824956

@ -45,16 +45,18 @@ pub fn watch<R: Runtime>(
global_scope: GlobalScope<Entry>, global_scope: GlobalScope<Entry>,
command_scope: CommandScope<Entry>, command_scope: CommandScope<Entry>,
) -> CommandResult<ResourceId> { ) -> CommandResult<ResourceId> {
let mut resolved_paths = Vec::with_capacity(paths.capacity()); let resolved_paths = paths
for path in paths { .into_iter()
resolved_paths.push(resolve_path( .map(|path| {
resolve_path(
&webview, &webview,
&global_scope, &global_scope,
&command_scope, &command_scope,
path, path,
options.base_dir, options.base_dir,
)?); )
} })
.collect::<CommandResult<Vec<_>>>()?;
let recursive_mode = if options.recursive { let recursive_mode = if options.recursive {
RecursiveMode::Recursive RecursiveMode::Recursive

Loading…
Cancel
Save