forked from M-Labs/zynq-rs
remove usage of BufReader
This commit is contained in:
parent
259c0fe842
commit
fd46cb9c8b
|
@ -57,8 +57,10 @@ fn parse_config<'a>(
|
||||||
file: fatfs::File<sd_reader::SdReader>,
|
file: fatfs::File<sd_reader::SdReader>,
|
||||||
) -> Result<'a, ()> {
|
) -> Result<'a, ()> {
|
||||||
let prefix = [key, "="].concat().to_ascii_lowercase();
|
let prefix = [key, "="].concat().to_ascii_lowercase();
|
||||||
for line in BufReader::new(file).lines() {
|
let mut read_buffer = String::new();
|
||||||
let line = line?.to_ascii_lowercase();
|
file.read_to_string(&mut read_buffer);
|
||||||
|
for line in read_buffer.lines() {
|
||||||
|
let line = line.to_ascii_lowercase();
|
||||||
if line.starts_with(&prefix) {
|
if line.starts_with(&prefix) {
|
||||||
buffer.extend(line[prefix.len()..].as_bytes());
|
buffer.extend(line[prefix.len()..].as_bytes());
|
||||||
return Ok(());
|
return Ok(());
|
||||||
|
|
Loading…
Reference in New Issue