@@ -17,16 +17,16 @@ let sdcard = embedded_sdmmc::SdCard::new(sdmmc_spi, delay);
17
17
println! (" Card size is {} bytes" , sdcard . num_bytes ()? );
18
18
// Now let's look for volumes (also known as partitions) on our block device.
19
19
// To do this we need a Volume Manager. It will take ownership of the block device.
20
- let mut volume_mgr = embedded_sdmmc :: VolumeManager :: new (sdcard , time_source );
20
+ let volume_mgr = embedded_sdmmc :: VolumeManager :: new (sdcard , time_source );
21
21
// Try and access Volume 0 (i.e. the first partition).
22
22
// The volume object holds information about the filesystem on that volume.
23
- let mut volume0 = volume_mgr . open_volume (embedded_sdmmc :: VolumeIdx (0 ))? ;
23
+ let volume0 = volume_mgr . open_volume (embedded_sdmmc :: VolumeIdx (0 ))? ;
24
24
println! (" Volume 0: {:?}" , volume0 );
25
25
// Open the root directory (mutably borrows from the volume).
26
- let mut root_dir = volume0 . open_root_dir ()? ;
26
+ let root_dir = volume0 . open_root_dir ()? ;
27
27
// Open a file called "MY_FILE.TXT" in the root directory
28
28
// This mutably borrows the directory.
29
- let mut my_file = root_dir . open_file_in_dir (" MY_FILE.TXT" , embedded_sdmmc :: Mode :: ReadOnly )? ;
29
+ let my_file = root_dir . open_file_in_dir (" MY_FILE.TXT" , embedded_sdmmc :: Mode :: ReadOnly )? ;
30
30
// Print the contents of the file, assuming it's in ISO-8859-1 encoding
31
31
while ! my_file . is_eof () {
32
32
let mut buffer = [0u8 ; 32 ];
@@ -43,7 +43,7 @@ By default the `VolumeManager` will initialize with a maximum number of `4` open
43
43
44
44
``` rust
45
45
// Create a volume manager with a maximum of 6 open directories, 12 open files, and 4 volumes (or partitions)
46
- let mut cont : VolumeManager <_ , _ , 6 , 12 , 4 > = VolumeManager :: new_with_limits (block , time_source );
46
+ let cont : VolumeManager <_ , _ , 6 , 12 , 4 > = VolumeManager :: new_with_limits (block , time_source );
47
47
```
48
48
49
49
## Supported features
0 commit comments