Skip to content

Commit 56619f8

Browse files
committed
Fix the warning about redundant import of impl_buffered_source when async-tokio feature is not enabled
Fixes the warning: ``` warning: the item `impl_buffered_source` is imported redundantly --> src\reader\buffered_reader.rs:235:16 | 13 | / macro_rules! impl_buffered_source { 14 | | ($($lf:lifetime, $reader:tt, $async:ident, $await:ident)?) => { 15 | | #[cfg(not(feature = "encoding"))] 16 | | $($async)? fn remove_utf8_bom(&mut self) -> Result<()> { ... | 231 | | }; 232 | | } | |_- the item `impl_buffered_source` is already defined here ... 235 | pub(super) use impl_buffered_source; | ^^^^^^^^^^^^^^^^^^^^ ```
1 parent 41763e9 commit 56619f8

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/reader/buffered_reader.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,11 @@ macro_rules! impl_buffered_source {
231231
};
232232
}
233233

234-
// Make it public for use in async implementations
234+
// Make it public for use in async implementations.
235+
// New rustc reports
236+
// > warning: the item `impl_buffered_source` is imported redundantly
237+
// so make it public only when async feature is enabled
238+
#[cfg(feature = "async-tokio")]
235239
pub(super) use impl_buffered_source;
236240

237241
/// Implementation of `XmlSource` for any `BufRead` reader using a user-given

0 commit comments

Comments
 (0)