Fix a syntax error in the sample code. #1
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
destructure_structures.md
の中のサンプルコードにと書かれてコメントアウトされたコードがありますが、このコードは
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 fieldx
".But this line ends with a
;
even though it is inmatch
, so it gives an error regardless of the mention ofx
.So replace the trailing semicolon with a comma.
Note: This will be the same modification as this pull request in the original document.