File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -266,12 +266,24 @@ impl Display for DoError { /* ... */ }
266
266
impl Error for DoError { /* ... */ }
267
267
```
268
268
269
+ The error message given by the ` Display ` representation of an error type should
270
+ be lowercase without trailing punctuation, and typically concise.
271
+
269
272
### Examples from the standard library
270
273
271
274
- [ ` ParseBoolError ` ] is returned when failing to parse a bool from a string.
272
275
273
276
[ `ParseBoolError` ] : https://doc.rust-lang.org/std/str/struct.ParseBoolError.html
274
277
278
+ ### Examples of error messages
279
+
280
+ - "unexpected end of file"
281
+ - "provided string was not \` true\` or \` false\` "
282
+ - "invalid IP address syntax"
283
+ - "second time provided was later than self"
284
+ - "invalid UTF-8 sequence of {} bytes from index {}"
285
+ - "environment variable was not valid unicode: {:?}"
286
+
275
287
276
288
<a id =" c-num-fmt " ></a >
277
289
## Binary number types provide ` Hex ` , ` Octal ` , ` Binary ` formatting (C-NUM-FMT)
You can’t perform that action at this time.
0 commit comments