Commit b02dcbd
committed
docs: Avoid using get(0) in examples
I used this example to implement tests, but clippy is not much happy
about that so changing also the docs to avoid leading by bad example
next fellow readers:
error: accessing first element with `attrs.get(0)`
--> cryptoki/tests/basic.rs:2528:26
|
2528 | assert!(matches!(attrs.get(0), Some(Attribute::UniqueId(_))));
| ^^^^^^^^^^^^ help: try: `attrs.first()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first
Signed-off-by: Jakub Jelen <jjelen@redhat.com>1 parent c7642c8 commit b02dcbd
1 file changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
| 60 | + | |
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| |||
413 | 413 | | |
414 | 414 | | |
415 | 415 | | |
416 | | - | |
| 416 | + | |
417 | 417 | | |
418 | 418 | | |
419 | 419 | | |
| |||
0 commit comments