Skip to content

Commit d855cd6

Browse files
committed
refactor(toml): remove unnecessary ? operators
1 parent 7ed7612 commit d855cd6

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

src/cargo/util/toml/mod.rs

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1894,7 +1894,7 @@ fn to_dependency_source_id<P: ResolveToPath + Clone>(
18941894
name_in_toml: &str,
18951895
manifest_ctx: &mut ManifestContext<'_, '_>,
18961896
) -> CargoResult<SourceId> {
1897-
let new_source_id = match (
1897+
match (
18981898
orig.git.as_ref(),
18991899
orig.path.as_ref(),
19001900
orig.registry.as_deref(),
@@ -1945,7 +1945,7 @@ fn to_dependency_source_id<P: ResolveToPath + Clone>(
19451945
manifest_ctx.warnings.push(msg);
19461946
}
19471947

1948-
SourceId::for_git(&loc, reference)?
1948+
SourceId::for_git(&loc, reference)
19491949
}
19501950
(None, Some(path), _, _) => {
19511951
let path = path.resolve(manifest_ctx.gctx);
@@ -1960,20 +1960,18 @@ fn to_dependency_source_id<P: ResolveToPath + Clone>(
19601960
if manifest_ctx.source_id.is_path() {
19611961
let path = manifest_ctx.root.join(path);
19621962
let path = paths::normalize_path(&path);
1963-
SourceId::for_path(&path)?
1963+
SourceId::for_path(&path)
19641964
} else {
1965-
manifest_ctx.source_id
1965+
Ok(manifest_ctx.source_id)
19661966
}
19671967
}
1968-
(None, None, Some(registry), None) => SourceId::alt_registry(manifest_ctx.gctx, registry)?,
1968+
(None, None, Some(registry), None) => SourceId::alt_registry(manifest_ctx.gctx, registry),
19691969
(None, None, None, Some(registry_index)) => {
19701970
let url = registry_index.into_url()?;
1971-
SourceId::for_registry(&url)?
1971+
SourceId::for_registry(&url)
19721972
}
1973-
(None, None, None, None) => SourceId::crates_io(manifest_ctx.gctx)?,
1974-
};
1975-
1976-
Ok(new_source_id)
1973+
(None, None, None, None) => SourceId::crates_io(manifest_ctx.gctx),
1974+
}
19771975
}
19781976

19791977
pub trait ResolveToPath {

0 commit comments

Comments
 (0)