Skip to content

Commit 089e257

Browse files
committed
manual: capitalize more examples properly.
1 parent 9ea5e6a commit 089e257

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

doc/rust.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2686,8 +2686,8 @@ fn add(x: int, y: int) -> int {
26862686
26872687
let mut x = add(5,7);
26882688
2689-
type binop = fn(int,int) -> int;
2690-
let bo: binop = add;
2689+
type Binop = fn(int,int) -> int;
2690+
let bo: Binop = add;
26912691
x = bo(5,7);
26922692
~~~~~~~~
26932693

@@ -2697,24 +2697,24 @@ Every trait item (see [traits](#traits)) defines a type with the same name
26972697
as the trait. For a trait `T`, cast expressions introduce values of type `T`:
26982698

26992699
~~~~~~~~
2700-
trait printable {
2700+
trait Printable {
27012701
fn to_str() -> ~str;
27022702
}
27032703
2704-
impl ~str: printable {
2704+
impl ~str: Printable {
27052705
fn to_str() -> ~str { self }
27062706
}
27072707
2708-
fn print(a: printable) {
2708+
fn print(a: Printable) {
27092709
io::println(a.to_str());
27102710
}
27112711
27122712
fn main() {
2713-
print(~"meow" as printable);
2713+
print(~"meow" as ~Printable);
27142714
}
27152715
~~~~~~~~
27162716

2717-
In this example, the trait `printable` occurs as a type in both the type signature of
2717+
In this example, the trait `Printable` occurs as a type in both the type signature of
27182718
`print`, and the cast expression in `main`.
27192719

27202720
### Type parameters
@@ -2740,16 +2740,16 @@ impl item. It refers to the type of the implicit `self` argument. For
27402740
example, in:
27412741

27422742
~~~~~~
2743-
trait printable {
2743+
trait Printable {
27442744
fn to_str() -> ~str;
27452745
}
27462746
2747-
impl ~str: printable {
2747+
impl ~str: Printable {
27482748
fn to_str() -> ~str { self }
27492749
}
27502750
~~~~~~
27512751

2752-
`self` refers to the value of type `str` that is the receiver for a
2752+
`self` refers to the value of type `~str` that is the receiver for a
27532753
call to the method `to_str`.
27542754

27552755
## Type kinds

0 commit comments

Comments
 (0)