Skip to content

Fix a syntax error in the sample code. #102

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

h1g0
Copy link
Contributor

@h1g0 h1g0 commented Dec 8, 2021

destructure_structures.mdの中のサンプルコードに

        // `x`に言及していないため、以下はエラーになる。
        //Foo { y } => println!("y = {}", y);

と書かれてコメントアウトされたコードがありますが、このコードはmatch式の中にもかかわらず;で終わっているため、コードの本来の意図とは異なり、xの言及にかかわらずエラーになります。

そのため、コードの意図に添ったエラーとするために、末尾の;,に置き換える修正をおこないました。

※原文のこちらのプルリクと同じ修正になります。


In a sample code of destructure_structures.md, there is a code that is commented out with "// this will give an error: pattern does not mention field x".
But this line ends with a ; even though it is in match, so it gives an error regardless of the mention of x.

So replace the trailing semicolon with a comma.

Note: This will be the same modification as this pull request in the original document.

In a sample code of `destructure_structures.md`, there is a code that is commented out with "// this will give an error: pattern does not mention field `x`".
But this line ends with a `;` even though it is in `match`, so it gives an error regardless of the mention of `x`.

So replace the trailing semicolon with a comma.

Note: This will be the same modification as [this pull request]( rust-lang/rust-by-example#1336 ) in the original document.
@dalance
Copy link
Contributor

dalance commented Dec 10, 2021

ありがとうございます。
このリポジトリでは原文との一致をCIで確認しているため、
原文への修正を個別に取り込むことはできない状況です。
原文を最新に更新して、修正をまとめて反映したいと思いますが
ちょっと時間がかかってしまうかもしれません。

@h1g0
Copy link
Contributor Author

h1g0 commented Dec 10, 2021

このリポジトリでは原文との一致をCIで確認しているため、
原文への修正を個別に取り込むことはできない状況です。

なるほど、承知しました。

原文の修正をまとめて反映させる予定とのことですので、このプルリクは一旦クローズさせていただきます。
(もし必要であれば随時Reopenしていただければと思います)

ご確認いただき、ありがとうございました!

@h1g0 h1g0 closed this Dec 10, 2021
@dalance
Copy link
Contributor

dalance commented Dec 11, 2021

@h1g0 #103 にて原文を最新版に更新しました。ご指摘いただいた箇所の修正も反映されています。

@h1g0
Copy link
Contributor Author

h1g0 commented Dec 11, 2021

@dalance
修正されていることを確認いたしました。
ご対応ありがとうございます!

@h1g0 h1g0 deleted the h1g0-patch-1 branch December 11, 2021 23:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants