diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2023-07-11 00:58:15 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-07-11 00:58:15 +0200 |
| commit | 87f978d83cd6bce3cb05dba855f07d9ca88ac112 (patch) | |
| tree | 3e67628bc58bc892269fe9ccc284b7339625a5e7 /src | |
| parent | 8ca44ef9caa4049d584fbbce218c219cdca33a2f (diff) | |
| parent | ddd5fd1e3cff5e0f1971fb8ba545804ac96652f5 (diff) | |
| download | rust-87f978d83cd6bce3cb05dba855f07d9ca88ac112.tar.gz rust-87f978d83cd6bce3cb05dba855f07d9ca88ac112.zip | |
Rollup merge of #113386 - joshtriplett:style-guide-combinable-expressions, r=compiler-errors
style-guide: Expand example of combinable expressions to include arrays Arrays are allowed as combinable expressions, but none of the examples show that.
Diffstat (limited to 'src')
| -rw-r--r-- | src/doc/style-guide/src/expressions.md | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/doc/style-guide/src/expressions.md b/src/doc/style-guide/src/expressions.md index 143161da6cf..40183063869 100644 --- a/src/doc/style-guide/src/expressions.md +++ b/src/doc/style-guide/src/expressions.md @@ -803,6 +803,16 @@ foo(|param| { action(); foo(param) }) + +let x = combinable([ + an_expr, + another_expr, +]); + +let arr = [combinable( + an_expr, + another_expr, +)]; ``` Such behaviour should extend recursively, however, tools may choose to limit the |
