File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
src/cargo/ops/cargo_package Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -243,12 +243,12 @@ fn do_package<'a>(
243
243
// The publish registry doesn't matter unless there are local dependencies,
244
244
// so only try to get one if we need it. If they explicitly passed a
245
245
// registry on the CLI, we check it no matter what.
246
- let sid = if deps. has_no_dependencies ( ) && opts. reg_or_index . is_none ( ) {
247
- None
248
- } else {
246
+ let sid = if deps. has_dependencies ( ) || opts. reg_or_index . is_some ( ) {
249
247
let sid = get_registry ( ws. gctx ( ) , & just_pkgs, opts. reg_or_index . clone ( ) ) ?;
250
248
debug ! ( "packaging for registry {}" , sid) ;
251
249
Some ( sid)
250
+ } else {
251
+ None
252
252
} ;
253
253
let reg_dir = ws. build_dir ( ) . join ( "package" ) . join ( "tmp-registry" ) ;
254
254
sid. map ( |sid| TmpRegistry :: new ( ws. gctx ( ) , reg_dir, sid) )
@@ -377,10 +377,10 @@ impl<T: Clone> LocalDependencies<T> {
377
377
. collect ( )
378
378
}
379
379
380
- pub fn has_no_dependencies ( & self ) -> bool {
380
+ pub fn has_dependencies ( & self ) -> bool {
381
381
self . graph
382
382
. iter ( )
383
- . all ( |node| self . graph . edges ( node) . next ( ) . is_none ( ) )
383
+ . any ( |node| self . graph . edges ( node) . next ( ) . is_some ( ) )
384
384
}
385
385
}
386
386
You can’t perform that action at this time.
0 commit comments