This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -101,8 +101,7 @@ fn execute() -> i32 {
101
101
102
102
let strategy = CargoFmtStrategy :: from_opts ( & opts) ;
103
103
104
- if opts. manifest_path . is_some ( ) {
105
- let specified_manifest_path = opts. manifest_path . unwrap ( ) ;
104
+ if let Some ( specified_manifest_path) = opts. manifest_path {
106
105
if !specified_manifest_path. ends_with ( "Cargo.toml" ) {
107
106
print_usage_to_stderr ( "the manifest-path must be a path to a Cargo.toml file" ) ;
108
107
return FAILURE ;
@@ -284,9 +283,11 @@ fn get_targets_root_only(
284
283
) -> Result < ( ) , io:: Error > {
285
284
let metadata = get_cargo_metadata ( manifest_path, false ) ?;
286
285
let workspace_root_path = PathBuf :: from ( & metadata. workspace_root ) . canonicalize ( ) ?;
287
- let ( in_workspace_root, current_dir_manifest) = if manifest_path. is_some ( ) {
288
- let target_manifest = manifest_path. unwrap ( ) . canonicalize ( ) ?;
289
- ( workspace_root_path == target_manifest, target_manifest)
286
+ let ( in_workspace_root, current_dir_manifest) = if let Some ( target_manifest) = manifest_path {
287
+ (
288
+ workspace_root_path == target_manifest,
289
+ target_manifest. canonicalize ( ) ?,
290
+ )
290
291
} else {
291
292
let current_dir = env:: current_dir ( ) ?. canonicalize ( ) ?;
292
293
(
You can’t perform that action at this time.
0 commit comments