@@ -1527,12 +1527,9 @@ of an item to see whether it should be allowed or not. This is where privacy
15271527warnings are generated, or otherwise "you used a private item of another module
15281528and weren't allowed to."
15291529
1530- By default, everything in rust is * private* , with two exceptions. The first
1531- exception is that struct fields are public by default (but the struct itself is
1532- still private by default), and the remaining exception is that enum variants in
1533- a ` pub ` enum are the default visibility of the enum container itself.. You are
1534- allowed to alter this default visibility with the ` pub ` keyword (or ` priv `
1535- keyword for struct fields and enum variants). When an item is declared as ` pub ` ,
1530+ By default, everything in rust is * private* , with one exception. Enum variants
1531+ in a ` pub ` enum are also public by default. You are allowed to alter this
1532+ default visibility with the ` priv ` keyword. When an item is declared as ` pub ` ,
15361533it can be thought of as being accessible to the outside world. For example:
15371534
15381535~~~~
@@ -1542,7 +1539,7 @@ struct Foo;
15421539
15431540// Declare a public struct with a private field
15441541pub struct Bar {
1545- priv field: int
1542+ field: int
15461543}
15471544
15481545// Declare a public enum with public and private variants
@@ -2354,7 +2351,7 @@ The following are examples of structure expressions:
23542351~~~~
23552352# struct Point { x: f64, y: f64 }
23562353# struct TuplePoint(f64, f64);
2357- # mod game { pub struct User<'a> { name: &'a str, age: uint, score: uint } }
2354+ # mod game { pub struct User<'a> { pub name: &'a str, pub age: uint, pub score: uint } }
23582355# struct Cookie; fn some_fn<T>(t: T) {}
23592356Point {x: 10.0, y: 20.0};
23602357TuplePoint(10.0, 20.0);
@@ -3140,7 +3137,7 @@ The types `char` and `str` hold textual data.
31403137A value of type ` char ` is a [ Unicode scalar value] (
31413138http://www.unicode.org/glossary/#unicode_scalar_value )
31423139(ie. a code point that is not a surrogate),
3143- represented as a 32-bit unsigned word in the 0x0000 to 0xD7FF
3140+ represented as a 32-bit unsigned word in the 0x0000 to 0xD7FF
31443141or 0xE000 to 0x10FFFF range.
31453142A ` [char] ` vector is effectively an UCS-4 / UTF-32 string.
31463143
0 commit comments