Skip to content

Commit 6a22454

Browse files
committed
Guide: Cargo now adds bang and drops the semicolon for ‘Hello, world’
1 parent a34b8de commit 6a22454

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/doc/guide.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1793,7 +1793,7 @@ Finally, Cargo generated a hello, world for us. Check out `src/main.rs`:
17931793

17941794
```{rust}
17951795
fn main() {
1796-
println!("Hello, world!");
1796+
println!("Hello, world!")
17971797
}
17981798
```
17991799

@@ -2682,12 +2682,12 @@ like this:
26822682

26832683
```
26842684
fn main() {
2685-
println!("Hello, world!");
2685+
println!("Hello, world!")
26862686
}
26872687
26882688
mod hello {
26892689
fn print_hello() {
2690-
println!("Hello, world!");
2690+
println!("Hello, world!")
26912691
}
26922692
}
26932693
```
@@ -2721,7 +2721,7 @@ fn main() {
27212721
27222722
mod hello {
27232723
fn print_hello() {
2724-
println!("Hello, world!");
2724+
println!("Hello, world!")
27252725
}
27262726
}
27272727
```
@@ -2744,7 +2744,7 @@ fn main() {
27442744
27452745
mod hello {
27462746
pub fn print_hello() {
2747-
println!("Hello, world!");
2747+
println!("Hello, world!")
27482748
}
27492749
}
27502750
```
@@ -2923,7 +2923,7 @@ $ cargo test
29232923
Compiling testing v0.0.1 (file:///home/you/projects/testing)
29242924
/home/you/projects/testing/src/main.rs:1:1: 3:2 warning: code is never used: `main`, #[warn(dead_code)] on by default
29252925
/home/you/projects/testing/src/main.rs:1 fn main() {
2926-
/home/you/projects/testing/src/main.rs:2 println!("Hello, world");
2926+
/home/you/projects/testing/src/main.rs:2 println!("Hello, world!")
29272927
/home/you/projects/testing/src/main.rs:3 }
29282928
29292929
running 0 tests
@@ -2962,7 +2962,7 @@ You can run all of your tests with `cargo test`. This runs both your tests in
29622962
```{notrust,ignore}
29632963
/home/you/projects/testing/src/main.rs:1:1: 3:2 warning: code is never used: `main`, #[warn(dead_code)] on by default
29642964
/home/you/projects/testing/src/main.rs:1 fn main() {
2965-
/home/you/projects/testing/src/main.rs:2 println!("Hello, world");
2965+
/home/you/projects/testing/src/main.rs:2 println!("Hello, world!")
29662966
/home/you/projects/testing/src/main.rs:3 }
29672967
```
29682968

@@ -3051,7 +3051,7 @@ function. Change your `src/main.rs` to look like this:
30513051
```{rust}
30523052
#[cfg(not(test))]
30533053
fn main() {
3054-
println!("Hello, world");
3054+
println!("Hello, world!")
30553055
}
30563056
```
30573057

@@ -3133,7 +3133,7 @@ extern crate testing;
31333133
31343134
#[cfg(not(test))]
31353135
fn main() {
3136-
println!("Hello, world");
3136+
println!("Hello, world!")
31373137
}
31383138
```
31393139

0 commit comments

Comments
 (0)