1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2025-03-27 16:25:43 +02:00

Minor whitespace changes (#2595)

This commit is contained in:
Nicole L 2025-02-06 09:52:29 -08:00 committed by GitHub
parent e1ed6eaf47
commit 6a25d7be04
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 11 additions and 1 deletions

View File

@ -14,8 +14,10 @@ the referenced data cannot change.
fn main() {
let a = 'A';
let b = 'B';
let mut r: &char = &a;
println!("r: {}", *r);
r = &b;
println!("r: {}", *r);
}

View File

@ -23,6 +23,7 @@ fn main() {
let mut s2: String = String::from("Hello ");
println!("s2: {s2}");
s2.push_str(s1);
println!("s2: {s2}");

View File

@ -6,6 +6,8 @@ minutes: 10
Like C and C++, Rust has support for custom structs:
<!-- dprint-ignore-start -->
```rust,editable
struct Person {
name: String,
@ -17,7 +19,10 @@ fn describe(person: &Person) {
}
fn main() {
let mut peter = Person { name: String::from("Peter"), age: 27 };
let mut peter = Person {
name: String::from("Peter"),
age: 27,
};
describe(&peter);
peter.age = 28;
@ -30,6 +35,8 @@ fn main() {
}
```
<!-- dprint-ignore-end -->
<details>
Key Points: