Skip to content

Commit 098e9e6

Browse files
Clippy fixes.
1 parent b132e04 commit 098e9e6

File tree

4 files changed

+6
-8
lines changed

4 files changed

+6
-8
lines changed

examples/create_test.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
1717
extern crate embedded_sdmmc;
1818

19-
const FILE_TO_CREATE: &'static str = "CREATE.TXT";
19+
const FILE_TO_CREATE: &str = "CREATE.TXT";
2020

2121
use embedded_sdmmc::{
2222
Block, BlockCount, BlockDevice, BlockIdx, Error, Mode, TimeSource, Timestamp, VolumeIdx,
@@ -158,9 +158,7 @@ fn main() {
158158
let buffer1 = b"\nFile Appended\n";
159159
let mut buffer: Vec<u8> = vec![];
160160
for _ in 0..64 {
161-
for _ in 0..15 {
162-
buffer.push(b'a');
163-
}
161+
buffer.resize(buffer.len() + 15, b'a');
164162
buffer.push(b'\n');
165163
}
166164
println!("\nAppending to file");

examples/delete_test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
1717
extern crate embedded_sdmmc;
1818

19-
const FILE_TO_DELETE: &'static str = "DELETE.TXT";
19+
const FILE_TO_DELETE: &str = "DELETE.TXT";
2020

2121
use embedded_sdmmc::{
2222
Block, BlockCount, BlockDevice, BlockIdx, Error, Mode, TimeSource, Timestamp, VolumeIdx,

examples/readme_test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ impl embedded_hal::blocking::spi::Transfer<u8> for FakeSpi {
1414

1515
impl embedded_hal::blocking::spi::Write<u8> for FakeSpi {
1616
type Error = core::convert::Infallible;
17-
fn write<'w>(&mut self, _words: &'w [u8]) -> Result<(), Self::Error> {
17+
fn write(&mut self, _words: &[u8]) -> Result<(), Self::Error> {
1818
Ok(())
1919
}
2020
}

examples/test_mount.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
2424
extern crate embedded_sdmmc;
2525

26-
const FILE_TO_PRINT: &'static str = "README.TXT";
27-
const FILE_TO_CHECKSUM: &'static str = "64MB.DAT";
26+
const FILE_TO_PRINT: &str = "README.TXT";
27+
const FILE_TO_CHECKSUM: &str = "64MB.DAT";
2828

2929
use embedded_sdmmc::{
3030
Block, BlockCount, BlockDevice, BlockIdx, Error, Mode, TimeSource, Timestamp, VolumeIdx,

0 commit comments

Comments
 (0)