E1008#
The modifier (pub
/priv
) is redundant here, since this field has such
visibility by default.
Erroneous example#
struct A {
priv value : Int
// Warning: The private modifier is redundant here
// since field value is private by default
}
pub struct B {
pub value : Int
// Warning: The public modifier is redundant here
// since field value is public by default
}
Suggestion#
Remove the visibility modifier on the field.
struct A {
value : Int
}
pub struct B {
value : Int
}