Skip to content

Commit 664c2fa

Browse files
authored
Merge pull request #319 from epage/style
style: Address warnings
2 parents cb1824b + 2617e71 commit 664c2fa

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

src/fmt/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ struct StyledValue<T> {
284284

285285
#[cfg(feature = "color")]
286286
impl<T: Display> Display for StyledValue<T> {
287-
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
287+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
288288
let style = self.style;
289289

290290
// We need to make sure `f`s settings don't get passed onto the styling but do get passed

src/fmt/writer/buffer.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ impl BufferWriter {
5858
let buf = buf.as_bytes();
5959
match &self.target {
6060
WritableTarget::WriteStdout => {
61-
let stream = std::io::stdout();
61+
let stream = io::stdout();
6262
#[cfg(feature = "color")]
6363
let stream = anstream::AutoStream::new(stream, self.write_style.into());
6464
let mut stream = stream.lock();
@@ -74,7 +74,7 @@ impl BufferWriter {
7474
print!("{}", buf);
7575
}
7676
WritableTarget::WriteStderr => {
77-
let stream = std::io::stderr();
77+
let stream = io::stderr();
7878
#[cfg(feature = "color")]
7979
let stream = anstream::AutoStream::new(stream, self.write_style.into());
8080
let mut stream = stream.lock();
@@ -105,7 +105,7 @@ impl BufferWriter {
105105
}
106106

107107
#[cfg(feature = "color")]
108-
fn adapt(buf: &[u8], write_style: WriteStyle) -> std::io::Result<Vec<u8>> {
108+
fn adapt(buf: &[u8], write_style: WriteStyle) -> io::Result<Vec<u8>> {
109109
use std::io::Write as _;
110110

111111
let adapted = Vec::with_capacity(buf.len());
@@ -155,7 +155,7 @@ pub(super) enum WritableTarget {
155155
/// Logs will be printed to standard error.
156156
PrintStderr,
157157
/// Logs will be sent to a custom pipe.
158-
Pipe(Box<Mutex<dyn std::io::Write + Send + 'static>>),
158+
Pipe(Box<Mutex<dyn io::Write + Send + 'static>>),
159159
}
160160

161161
impl std::fmt::Debug for WritableTarget {

src/fmt/writer/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,8 @@ impl Builder {
123123
#[cfg(feature = "auto-color")]
124124
let color_choice = if color_choice == WriteStyle::Auto {
125125
match &self.target {
126-
Target::Stdout => anstream::AutoStream::choice(&std::io::stdout()).into(),
127-
Target::Stderr => anstream::AutoStream::choice(&std::io::stderr()).into(),
126+
Target::Stdout => anstream::AutoStream::choice(&io::stdout()).into(),
127+
Target::Stderr => anstream::AutoStream::choice(&io::stderr()).into(),
128128
Target::Pipe(_) => color_choice,
129129
}
130130
} else {

src/logger.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -240,9 +240,9 @@ impl Builder {
240240
/// [`Formatter`]: fmt/struct.Formatter.html
241241
/// [`String`]: https://doc.rust-lang.org/stable/std/string/struct.String.html
242242
/// [`std::fmt`]: https://doc.rust-lang.org/std/fmt/index.html
243-
pub fn format<F: 'static>(&mut self, format: F) -> &mut Self
243+
pub fn format<F>(&mut self, format: F) -> &mut Self
244244
where
245-
F: Fn(&mut Formatter, &Record<'_>) -> io::Result<()> + Sync + Send,
245+
F: Fn(&mut Formatter, &Record<'_>) -> io::Result<()> + Sync + Send + 'static,
246246
{
247247
self.format.custom_format = Some(Box::new(format));
248248
self

0 commit comments

Comments
 (0)