fixed some formatting
This commit is contained in:
parent
1a5bdaaf77
commit
8329fff047
|
@ -54,7 +54,7 @@ fn main() {
|
||||||
|
|
||||||
// Fix all errors without adding newline
|
// Fix all errors without adding newline
|
||||||
fn main() {
|
fn main() {
|
||||||
let s = String::from("hello");
|
let s = String::from("hello");
|
||||||
s.push(',');
|
s.push(',');
|
||||||
s.push(" world");
|
s.push(" world");
|
||||||
s += "!".to_string();
|
s += "!".to_string();
|
||||||
|
@ -89,8 +89,8 @@ fn main() {
|
||||||
let s1 = String::from("hello,");
|
let s1 = String::from("hello,");
|
||||||
let s2 = String::from("world!");
|
let s2 = String::from("world!");
|
||||||
let s3 = s1 + s2;
|
let s3 = s1 + s2;
|
||||||
assert_eq!(s3,"hello,world!");
|
assert_eq!(s3, "hello,world!");
|
||||||
println!("{}",s1);
|
println!("{}", s1);
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -107,7 +107,7 @@ fn main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn greetings(s: String) {
|
fn greetings(s: String) {
|
||||||
println!("{}",s)
|
println!("{}", s)
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -140,7 +140,7 @@ fn main() {
|
||||||
println!("Unicode character {} (U+211D) is called {}",
|
println!("Unicode character {} (U+211D) is called {}",
|
||||||
unicode_codepoint, character_name );
|
unicode_codepoint, character_name );
|
||||||
|
|
||||||
let long_string = "String literals
|
let long_string = "String literals
|
||||||
can span multiple lines.
|
can span multiple lines.
|
||||||
The linebreak and indentation here \
|
The linebreak and indentation here \
|
||||||
can be escaped too!";
|
can be escaped too!";
|
||||||
|
@ -163,7 +163,7 @@ fn main() {
|
||||||
|
|
||||||
// If you need "# in your string, just use more #s in the delimiter.
|
// If you need "# in your string, just use more #s in the delimiter.
|
||||||
// You can use up to 65535 #s.
|
// You can use up to 65535 #s.
|
||||||
let delimiter = r###"A string with "# in it. And even "##!"###;
|
let delimiter = r###"A string with "# in it. And even "##!"###;
|
||||||
println!("{}", delimiter);
|
println!("{}", delimiter);
|
||||||
|
|
||||||
let long_delimiter = __;
|
let long_delimiter = __;
|
||||||
|
@ -262,4 +262,4 @@ fn main() {
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
> You can find the solutions [here](https://github.com/sunface/rust-by-practice)(under the solutions path), but only use it when you need it
|
> You can find the solutions [here](https://github.com/sunface/rust-by-practice)(under the solutions path), but only use it when you need it
|
||||||
|
|
Loading…
Reference in New Issue