File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -84,6 +84,13 @@ This allows to run `RUST_BACKTRACE=1 cargo test`
84
84
and get a backtrace with line numbers in resultified tests
85
85
which return ` anyhow::Result ` .
86
86
87
+ ` unwrap ` and ` expect ` are not used in the library
88
+ because panics are difficult to debug on user devices.
89
+ However, in the tests ` .expect ` may be used.
90
+ Follow
91
+ < https://doc.rust-lang.org/core/error/index.html#common-message-styles >
92
+ for ` .expect ` message style.
93
+
87
94
## Logging
88
95
89
96
For logging, use ` info! ` , ` warn! ` and ` error! ` macros.
@@ -96,3 +103,17 @@ Format anyhow errors with `{:#}` to print all the contexts like this:
96
103
```
97
104
error!(context, "Failed to set selfavatar timestamp: {err:#}.");
98
105
```
106
+
107
+ ## Documentation comments
108
+
109
+ All public modules, methods and fields should be documented.
110
+ This is checked by [ ` missing_docs ` ] ( https://doc.rust-lang.org/rustdoc/lints.html#missing_docs ) lint.
111
+
112
+ Private items do not have to be documented,
113
+ but CI uses ` cargo doc --document-private-items `
114
+ to build the documentation,
115
+ so it is preferred that new items
116
+ are documented.
117
+
118
+ Follow Rust guidelines for the documentation comments:
119
+ < https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#summary-sentence >
You can’t perform that action at this time.
0 commit comments