Skip to content

Commit 5c6d905

Browse files
committed
Get rid of if_chain dependency
1 parent 9ba7eea commit 5c6d905

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

spdlog/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ chrono = "0.4.22"
4949
crossbeam = { version = "0.8.2", optional = true }
5050
dyn-clone = "1.0.14"
5151
flexible-string = { version = "0.1.0", optional = true }
52-
if_chain = "1.0.2"
5352
is-terminal = "0.4"
5453
log = { version = "0.4.21", optional = true, features = ["kv"] }
5554
once_cell = "1.16.0"

spdlog/src/sink/std_stream_sink.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ use std::{
55
io::{self, Write},
66
};
77

8-
use if_chain::if_chain;
9-
108
use crate::{
119
formatter::{Formatter, FormatterContext},
1210
sink::{GetSinkProp, Sink, SinkProp},
@@ -176,10 +174,9 @@ impl Sink for StdStreamSink {
176174
let mut dest = self.dest.lock();
177175

178176
(|| {
179-
if_chain! {
180-
if self.should_render_style;
181-
if let Some(style_range) = ctx.style_range();
182-
then {
177+
// TODO: Simplify the if block when our MSRV reaches let-chain support.
178+
if self.should_render_style {
179+
if let Some(style_range) = ctx.style_range() {
183180
let style = self.level_styles.style(record.level());
184181

185182
dest.write_all(string_buf[..style_range.start].as_bytes())?;
@@ -190,7 +187,10 @@ impl Sink for StdStreamSink {
190187
} else {
191188
dest.write_all(string_buf.as_bytes())?;
192189
}
190+
} else {
191+
dest.write_all(string_buf.as_bytes())?;
193192
}
193+
194194
Ok(())
195195
})()
196196
.map_err(Error::WriteRecord)?;

0 commit comments

Comments
 (0)