Skip to content

Commit fa36e6e

Browse files
committed
refactor: nits in resolve_registry_or_index()
1 parent 3ec8f14 commit fa36e6e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/cargo/ops/registry/publish.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -799,7 +799,9 @@ fn resolve_registry_or_index(
799799
opts: &PublishOpts<'_>,
800800
just_pkgs: &[&Package],
801801
) -> CargoResult<Option<RegistryOrIndex>> {
802-
Ok(match opts.reg_or_index.clone() {
802+
let opt_index_or_registry = opts.reg_or_index.clone();
803+
804+
let res = match opt_index_or_registry {
803805
Some(r) => {
804806
validate_registry(&just_pkgs, Some(&r))?;
805807
Some(r)
@@ -818,7 +820,9 @@ fn resolve_registry_or_index(
818820
}
819821
reg
820822
}
821-
})
823+
};
824+
825+
Ok(res)
822826
}
823827

824828
fn validate_registry(pkgs: &[&Package], reg_or_index: Option<&RegistryOrIndex>) -> CargoResult<()> {

0 commit comments

Comments
 (0)