Skip to content

Commit c10930a

Browse files
committed
comment
1 parent 551c055 commit c10930a

File tree

1 file changed

+2
-3
lines changed
  • tracing-build-script/src

1 file changed

+2
-3
lines changed

tracing-build-script/src/lib.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ impl Write for BuildScriptWriter {
8686
// so we need to lock it to prevent other threads from clobbering our output.
8787
let mut writer = writer.lock();
8888

89+
// depending on the current state we may need to prefix the output
8990
match *state {
9091
ErrorAndWarnState::Init => {
9192
writer.write_all(b"cargo::warning=")?;
@@ -110,9 +111,7 @@ impl Write for BuildScriptWriter {
110111
// We know which case we are in
111112
// either when we enter this function the next time (case 1)
112113
// or the next time or when we enter the destructor (case 2).
113-
let last_char = buf.last().copied();
114-
115-
match last_char {
114+
match buf.last().copied() {
116115
Some(ch) if char_is_special(ch) => {
117116
// we strip the special char at the end so that the call to split
118117
// does not yield an empty slice in the end

0 commit comments

Comments
 (0)