Skip to content

Commit

Permalink
Update README example
Browse files Browse the repository at this point in the history
Notes that converting a byte to a char is assuming the the file is ISO-8859-1 encoded.
  • Loading branch information
thejpster committed Jun 1, 2024
1 parent 7b5b876 commit 6b1ef4c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ let mut root_dir = volume0.open_root_dir()?;
// Open a file called "MY_FILE.TXT" in the root directory
// This mutably borrows the directory.
let mut my_file = root_dir.open_file_in_dir("MY_FILE.TXT", embedded_sdmmc::Mode::ReadOnly)?;
// Print the contents of the file
// Print the contents of the file, assuming it's in ISO-8859-1 encoding
while !my_file.is_eof() {
let mut buffer = [0u8; 32];
let num_read = my_file.read(&mut buffer)?;
Expand Down
2 changes: 1 addition & 1 deletion examples/readme_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ fn main() -> Result<(), Error> {
// Open a file called "MY_FILE.TXT" in the root directory
// This mutably borrows the directory.
let mut my_file = root_dir.open_file_in_dir("MY_FILE.TXT", embedded_sdmmc::Mode::ReadOnly)?;
// Print the contents of the file
// Print the contents of the file, assuming it's in ISO-8859-1 encoding
while !my_file.is_eof() {
let mut buffer = [0u8; 32];
let num_read = my_file.read(&mut buffer)?;
Expand Down

0 comments on commit 6b1ef4c

Please sign in to comment.