Skip to content

Commit 6b1ef4c

Browse files
committed
Update README example
Notes that converting a byte to a char is assuming the the file is ISO-8859-1 encoded.
1 parent 7b5b876 commit 6b1ef4c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ let mut root_dir = volume0.open_root_dir()?;
2727
// Open a file called "MY_FILE.TXT" in the root directory
2828
// This mutably borrows the directory.
2929
let mut my_file = root_dir.open_file_in_dir("MY_FILE.TXT", embedded_sdmmc::Mode::ReadOnly)?;
30-
// Print the contents of the file
30+
// Print the contents of the file, assuming it's in ISO-8859-1 encoding
3131
while !my_file.is_eof() {
3232
let mut buffer = [0u8; 32];
3333
let num_read = my_file.read(&mut buffer)?;

examples/readme_test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ fn main() -> Result<(), Error> {
120120
// Open a file called "MY_FILE.TXT" in the root directory
121121
// This mutably borrows the directory.
122122
let mut my_file = root_dir.open_file_in_dir("MY_FILE.TXT", embedded_sdmmc::Mode::ReadOnly)?;
123-
// Print the contents of the file
123+
// Print the contents of the file, assuming it's in ISO-8859-1 encoding
124124
while !my_file.is_eof() {
125125
let mut buffer = [0u8; 32];
126126
let num_read = my_file.read(&mut buffer)?;

0 commit comments

Comments
 (0)