Skip to content

Commit e2b18c7

Browse files
authored
Merge pull request #52 from tomoyuki-nakabayashi/fix_hello
Fix typo and improve translation.
2 parents 1f7a06b + 1aa8cc2 commit e2b18c7

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

examples/hello/print/print_display/display.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ impl fmt::Display for MinMax {
1515

1616
// 比較のため、フィールドに名前をつけれる様な構造体を定義しましょう
1717
#[derive(Debug)]
18-
struct Point2 {
18+
struct Point2D {
1919
x: f64,
2020
y: f64,
2121
}
2222

23-
// 先程と同様にして、Point2用の`Display`を実装しています。
24-
impl fmt::Display for Point2 {
23+
// 先程と同様にして、Point2D用の`Display`を実装しています。
24+
impl fmt::Display for Point2D {
2525
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2626
// `x`と`y`のみが明示的になるようにカスタマイズ
2727
write!(f, "x: {}, y: {}", self.x, self.y)
@@ -42,7 +42,7 @@ fn main() {
4242
small = small_range,
4343
big = big_range);
4444

45-
let point = Point2 { x: 3.3, y: 7.2 };
45+
let point = Point2D { x: 3.3, y: 7.2 };
4646

4747
println!("Compare points:");
4848
println!("Display: {}", point);

examples/hello/print/print_display/input.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,10 @@ impl fmt::Display for Structure {
6161

6262
### 演習
6363

64-
<!--- After checking the output of the above example, use the `Point2` struct as --->
64+
<!--- After checking the output of the above example, use the `Point2D` struct as --->
6565
<!--- guide to add a Complex struct to the example. When printed in the same --->
6666
<!--- way, the output should be: --->
67-
上記の例のアウトプットを確認し、`Point2`構造体を使用して、複素数を格納するための構造体を定義しましょう。うまく行けば以下のように出力されるはずです。
67+
上記の例のアウトプットを確認し、`Point2D`構造体を参考として、複素数を格納するための構造体を定義しましょう。うまく行けば以下のように出力されるはずです。
6868

6969
```
7070
Display: 3.3 + 7.2i

0 commit comments

Comments
 (0)