Skip to content

Commit 3301673

Browse files
authored
Merge pull request #142 from kdnakt/translate-alias
Translate untranslated lines in alias.md
2 parents 00d50c1 + 6e59bca commit 3301673

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/scope/borrow/alias.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,21 @@ fn main() {
3131
// ミュータブルに借用することができない。
3232
// let mutable_borrow = &mut point;
3333
// TODO ^ Try uncommenting this line
34+
// TODO ^ この行をアンコメントしてみましょう。
3435
3536
// The borrowed values are used again here
37+
// 借用された値はここで再び利用されます。
3638
println!("Point has coordinates: ({}, {}, {})",
3739
borrowed_point.x, another_borrow.y, point.z);
3840
3941
// The immutable references are no longer used for the rest of the code so
4042
// it is possible to reborrow with a mutable reference.
43+
// イミュータブルな参照がこれ以降のコードで利用されていないため、
44+
// ミュータブルな参照として再借用できます。
4145
let mutable_borrow = &mut point;
4246
4347
// Change data via mutable reference
44-
// ミュータブルなリファレンスを介してデータを変更する
48+
// ミュータブルな参照を介してデータを変更する
4549
mutable_borrow.x = 5;
4650
mutable_borrow.y = 2;
4751
mutable_borrow.z = 1;
@@ -55,17 +59,19 @@ fn main() {
5559
// TODO ^ この行をアンコメントしてみましょう。
5660
5761
// Error! Can't print because `println!` takes an immutable reference.
58-
// エラー!`println!`はイミュータブルなリファレンスを取るため、printできません。
62+
// エラー!`println!`はイミュータブルな参照を取るため、printできません。
5963
// println!("Point Z coordinate is {}", point.z);
6064
// TODO ^ Try uncommenting this line
6165
// TODO ^ この行をアンコメントしてみましょう。
6266
6367
// Ok! Mutable references can be passed as immutable to `println!`
68+
// OK!ミュータブルな参照は`println!`にイミュータブルな参照として渡せます。
6469
println!("Point has coordinates: ({}, {}, {})",
6570
mutable_borrow.x, mutable_borrow.y, mutable_borrow.z);
6671
6772
// The mutable reference is no longer used for the rest of the code so it
6873
// is possible to reborrow
74+
// ミュータブルな参照がこれ以降のコードで利用されていないため、再借用できます。
6975
let new_borrowed_point = &point;
7076
println!("Point now has coordinates: ({}, {}, {})",
7177
new_borrowed_point.x, new_borrowed_point.y, new_borrowed_point.z);

0 commit comments

Comments
 (0)