We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent df4d209 commit 2de44c4Copy full SHA for 2de44c4
src/cargo/core/dependency.rs
@@ -301,8 +301,10 @@ impl Dependency {
301
302
/// Sets whether the dependency is public.
303
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);
+ if !public {
+ // Setting 'private' only makes sense for normal dependencies
306
+ assert_eq!(self.kind(), Kind::Normal);
307
+ }
308
Rc::make_mut(&mut self.inner).public = public;
309
self
310
}
0 commit comments