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
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -199,7 +199,7 @@ enum Colors {
199
199
200
200
=== Formatting of struct fields and enum variants
201
201
202
-
We add newlines to struct fields and enum variants when they include additional information like documentation comments or attributes, because the variants can become difficult to read.
202
+
Add newlines to struct fields and enum variants when they include additional information like documentation comments or attributes, because the variants can become difficult to read.
203
203
This is especially the case when fields include doc comments, attributes like `#[snafu()]`, and in case of enum variants, various embedded types.
204
204
205
205
Enum variants and struct fields don't need to be separated when **no** additional information is attached to any of the variants or fields.
@@ -279,12 +279,12 @@ Comments should only be added if they provide additional information not availab
279
279
280
280
=== Choice of error crate and usage
281
281
282
-
We use `snafu` for all error handling in library *and* application code because we want to provide as much context to the user as possible.
282
+
Use `snafu` for all error handling in library *and* application code to provide as much context to the user as possible.
283
283
Further, `snafu` allows us to use the same source error in multiple error variants.
284
-
This feature can be used for cases were we need / require more fine-grained error variants.
284
+
This feature can be used for cases where more fine-grained error variants are required.
285
285
This behaviour is not possible when using `thiserror`, as it uses the `From` trait to convert the source error into an error variant.
286
286
287
-
Additionally, we restrict the usage of the `#[snafu(context(false))]` atrribute on error variants.
287
+
Additionally, the usage of the `#[snafu(context(false))]` atrribute on error variants is restricted.
288
288
This ensures that fallible functions need to call `.context()` to pass the error along.
0 commit comments