Skip to content

Commit

Permalink
Minor whitespace changes (#2595)
Browse files Browse the repository at this point in the history
  • Loading branch information
randomPoison authored Feb 6, 2025
1 parent e1ed6ea commit 6a25d7b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/references/shared.md
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
1 change: 1 addition & 0 deletions src/references/strings.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ fn main() {
let mut s2: String = String::from("Hello ");
println!("s2: {s2}");
s2.push_str(s1);
println!("s2: {s2}");
Expand Down
9 changes: 8 additions & 1 deletion src/user-defined-types/named-structs.md
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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;
Expand All @@ -30,6 +35,8 @@ fn main() {
}
```

<!-- dprint-ignore-end -->

<details>

Key Points:
Expand Down

0 comments on commit 6a25d7b

Please sign in to comment.