You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: modules/contributor/pages/code-style-guide.adoc
+7-7Lines changed: 7 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -425,20 +425,20 @@ enum Error {
425
425
==== Examples for "failed to ..." error messages
426
426
427
427
. `failed to parse config file` to indicate the parsing of the config file failed, usually because the file doesn't conform to the configuration language.
428
-
. `failed to construct http client` to indicate we wanted to construct a HTTP client to retrieve remote content.
428
+
. `failed to construct http client` to indicate that the construction of a HTTP client to retrieve remote content failed.
429
429
430
430
==== Exampled for "unable to ..." error messages
431
431
432
-
. `unable to read config file from ...` to indicate we could load the file (for example because the file doesn't exist).
433
-
. `unable to parse value ...` to indicate we failed to parse a user provided value which didn't conform to the expected syntax.
432
+
. `unable to read config file from ...` to indicate that the file could not be loaded (for example because the file doesn't exist).
433
+
. `unable to parse value ...` to indicate that parsing a user provided value failed (for example because it didn't conform to the expected syntax).
434
434
435
435
== String formatting
436
436
437
437
=== Named versus unnamed format string identifiers
438
438
439
-
For simple string formatting (up to two substitutions), we allow unnamed (and thus also uncaptured) identifiers.
439
+
For simple string formatting (up to two substitutions), unnamed (and thus also uncaptured) identifiers are allowed.
440
440
441
-
For more complex formatting (more than two substitutions), we require named identifiers to avoid ambiguity, and to decouple argument order from the text (which can lead to incorrect text when the wording is changed and `{}` are reordered while the arguments aren't).
441
+
For more complex formatting (more than two substitutions), named identifiers are required to avoid ambiguity, and to decouple argument order from the text (which can lead to incorrect text when the wording is changed and `{}` are reordered while the arguments aren't).
442
442
This rule needs to strike a balance between explicitness and concise `format!()` invocations.
443
443
Long `format!()` expressions can lead to rustfmt breakage.
444
444
It might be better to split up long formatting strings into multiple smaller ones.
@@ -488,7 +488,7 @@ format!(
488
488
489
489
=== Captured versus uncaptured format string identifiers
490
490
491
-
We place no restriction on named format string identifiers.
491
+
There are no restrictions on named format string identifiers.
492
492
All options below are considered valid.
493
493
494
494
[source,rust]
@@ -504,7 +504,7 @@ format!("Hello {name}, hello again {name}", name = greetee);
504
504
505
505
== Specifying resources measured in bytes and CPU fractions
506
506
507
-
We follow the Kubernetes convention described https://kubernetes.io/docs/reference/kubernetes-api/common-definitions/quantity/[here].
507
+
Follow the Kubernetes convention described https://kubernetes.io/docs/reference/kubernetes-api/common-definitions/quantity/[here].
0 commit comments