Skip to content

Commit

Permalink
Relax assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaron1011 committed Apr 26, 2019
1 parent df4d209 commit 2de44c4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/cargo/core/dependency.rs
Original file line number Diff line number Diff line change
Expand Up @@ -301,8 +301,10 @@ impl Dependency {

/// Sets whether the dependency is public.
pub fn set_public(&mut self, public: bool) -> &mut Dependency {
// Setting 'public' only makes sense for normal dependencies
assert_eq!(self.kind(), Kind::Normal);
if !public {
// Setting 'private' only makes sense for normal dependencies
assert_eq!(self.kind(), Kind::Normal);
}
Rc::make_mut(&mut self.inner).public = public;
self
}
Expand Down

0 comments on commit 2de44c4

Please sign in to comment.