The pub
keyword was used inside a public enum.
Erroneous code example:
pub enum Foo {
pub Bar, // error: unnecessary `pub` visibility
}
RunSince the enum is already public, adding pub
on one its elements is
unnecessary. Example:
enum Foo {
pub Bar, // not ok!
}
RunThis is the correct syntax:
pub enum Foo {
Bar, // ok!
}
Run