Skip to content

Commit 2de44c4

Browse files
committed
Relax assertion
1 parent df4d209 commit 2de44c4

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/cargo/core/dependency.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -301,8 +301,10 @@ impl Dependency {
301301

302302
/// Sets whether the dependency is public.
303303
pub fn set_public(&mut self, public: bool) -> &mut Dependency {
304-
// Setting 'public' only makes sense for normal dependencies
305-
assert_eq!(self.kind(), Kind::Normal);
304+
if !public {
305+
// Setting 'private' only makes sense for normal dependencies
306+
assert_eq!(self.kind(), Kind::Normal);
307+
}
306308
Rc::make_mut(&mut self.inner).public = public;
307309
self
308310
}

0 commit comments

Comments
 (0)