Skip to content

Commit

Permalink
Fix : #6
Browse files Browse the repository at this point in the history
  • Loading branch information
caofengyi authored and caofengyi committed Feb 2, 2024
1 parent 081a30d commit 08c511e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ use crate::Result;
#[cfg(feature = "runtime-async-std")]
use async_std::{
io::prelude::*,
io::{BufReader as ioBufReader, Cursor, Error as ioError, ioErrorKind},
io::{BufReader as ioBufReader, Cursor as ioCursor, Error as ioError, ErrorKind as ioErrorKind},
};

#[cfg(all(feature = "runtime-async-std", not(target_arch = "wasm32")))]
use async_std::{fs::File as file, path::Path as ioPath};

#[cfg(feature = "runtime-tokio")]
use std::{io::Cursor as tokioCursor, path::Path as ioPath};
use std::{io::Cursor as ioCursor, path::Path as ioPath};
#[cfg(feature = "runtime-tokio")]
use tokio::io::{
AsyncBufReadExt, AsyncReadExt, BufReader as ioBufReader, Error as ioError, ErrorKind as ioErrorKind,
Expand Down Expand Up @@ -46,7 +46,7 @@ impl Config {
data: HashMap::new(),
};

c.parse_buffer(&mut ioBufReader::new(tokioCursor::new(s.as_ref().as_bytes())))
c.parse_buffer(&mut ioBufReader::new(ioCursor::new(s.as_ref().as_bytes())))
.await?;
Ok(c)
}
Expand All @@ -57,14 +57,14 @@ impl Config {
let mut c = Vec::new();
f.read_to_end(&mut c).await?;

let mut reader: ioBufReader<tokioCursor<&[u8]>> =
ioBufReader::new(tokioCursor::new(&c));
let mut reader: ioBufReader<ioCursor<&[u8]>> =
ioBufReader::new(ioCursor::new(&c));

Check warning on line 61 in src/config.rs

View check run for this annotation

Codecov / codecov/patch

src/config.rs#L61

Added line #L61 was not covered by tests
self.parse_buffer(&mut reader).await
}

async fn parse_buffer(
&mut self,
reader: &mut ioBufReader<tokioCursor<&[u8]>>,
reader: &mut ioBufReader<ioCursor<&[u8]>>,
) -> Result<()> {
let mut section = String::new();

Expand Down

0 comments on commit 08c511e

Please sign in to comment.