From ed3d672d806790b3559bed4b443bb5a75b2bab9a Mon Sep 17 00:00:00 2001 From: PedroChaps Date: Tue, 28 Jan 2025 01:06:11 +0000 Subject: [PATCH 1/3] Fix typo --- src/ch05-03-method-syntax.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ch05-03-method-syntax.md b/src/ch05-03-method-syntax.md index e03180f2a5..9a681b4d90 100644 --- a/src/ch05-03-method-syntax.md +++ b/src/ch05-03-method-syntax.md @@ -38,7 +38,7 @@ The `&self` is actually short for `self: &Self`. Within an `impl` block, the type `Self` is an alias for the type that the `impl` block is for. Methods must have a parameter named `self` of type `Self` for their first parameter, so Rust lets you abbreviate this with only the name `self` in the first parameter spot. -Note that we still need to use the `&` in front of the `self` shorthand to +Note that we still need to use the `&` behind the `self` shorthand to indicate that this method borrows the `Self` instance, just as we did in `rectangle: &Rectangle`. Methods can take ownership of `self`, borrow `self` immutably, as we’ve done here, or borrow `self` mutably, just as they can any From a01931aafca4162d267ffbc3103ce4dc25d6bf67 Mon Sep 17 00:00:00 2001 From: PedroChaps Date: Tue, 28 Jan 2025 01:10:27 +0000 Subject: [PATCH 2/3] fix `dprint` command --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 68a2dc0c28..7c3f4252a5 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -37,7 +37,7 @@ Or follow the [instructions][install-dprint] on the `dprint` website. [install-dprint]: https://dprint.dev/install/ To format Rust code, you can run `rustfmt `, and to format other -files, you can pass `dprint `. Many text editors also have native +files, you can pass `dprint fmt `. Many text editors also have native support or extensions for both `rustfmt` and `dprint`. ## Checking for Fixes From b739fe464ab21999a1a4067ba7a3d166fac671a9 Mon Sep 17 00:00:00 2001 From: PedroChaps Date: Fri, 31 Jan 2025 22:15:00 +0000 Subject: [PATCH 3/3] Revert "Fix typo" This reverts commit ed3d672d806790b3559bed4b443bb5a75b2bab9a. --- src/ch05-03-method-syntax.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ch05-03-method-syntax.md b/src/ch05-03-method-syntax.md index 9a681b4d90..e03180f2a5 100644 --- a/src/ch05-03-method-syntax.md +++ b/src/ch05-03-method-syntax.md @@ -38,7 +38,7 @@ The `&self` is actually short for `self: &Self`. Within an `impl` block, the type `Self` is an alias for the type that the `impl` block is for. Methods must have a parameter named `self` of type `Self` for their first parameter, so Rust lets you abbreviate this with only the name `self` in the first parameter spot. -Note that we still need to use the `&` behind the `self` shorthand to +Note that we still need to use the `&` in front of the `self` shorthand to indicate that this method borrows the `Self` instance, just as we did in `rectangle: &Rectangle`. Methods can take ownership of `self`, borrow `self` immutably, as we’ve done here, or borrow `self` mutably, just as they can any