Commit 8454d66
committed
chromium_mod: First convert then slice
More efficient. Highlighted by new clippy lint:
```
error: calling `as_bytes` after slicing a string
--> framework_lib/src/chromium_ec/mod.rs:919:45
|
919 | request.name[..end].copy_from_slice(name[..end].as_bytes());
| ^^^^^^^^^^^^^^^^^^^^^^ help: try: `&name.as_bytes()[..end]`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#sliced_string_as_bytes
= note: `-D clippy::sliced-string-as-bytes` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::sliced_string_as_bytes)]`
```
Signed-off-by: Daniel Schaefer <dhs@frame.work>1 parent 4aa392a commit 8454d66
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
916 | 916 | | |
917 | 917 | | |
918 | 918 | | |
919 | | - | |
| 919 | + | |
920 | 920 | | |
921 | 921 | | |
922 | 922 | | |
| |||
0 commit comments