We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 32b089d + 4f5d2ff commit 8146700Copy full SHA for 8146700
docs/dev/style.md
@@ -112,6 +112,22 @@ Avoid local `use MyEnum::*` imports.
112
113
Prefer `use crate::foo::bar` to `use super::bar`.
114
115
+When implementing `Debug` or `Display`, import `std::fmt`:
116
+
117
+```rust
118
+// Good
119
+use std::fmt;
120
121
+impl fmt::Display for RenameError {
122
+ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { .. }
123
+}
124
125
+// Not as good
126
+impl std::fmt::Display for RenameError {
127
+ fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { .. }
128
129
+```
130
131
# Order of Items
132
133
Optimize for the reader who sees the file for the first time, and wants to get a general idea about what's going on.
0 commit comments