Skip to content

Commit bc20da4

Browse files
committed
Log stdin
1 parent 2871a13 commit bc20da4

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/inner.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,11 @@ async fn mainloop(
8383
};
8484

8585
let mut input = token.serialize();
86-
input.extend_from_slice(msg.as_bytes());
87-
input.push(b'\n');
86+
input.push_str(&msg);
87+
input.push('\n');
8888

89-
if let Err(err) = stdin.write_all(&input).await {
89+
debug!("Sending {}", input);
90+
if let Err(err) = stdin.write_all(&input.as_bytes()).await {
9091
error!("Failed to write, stopping: {}", err);
9192
break;
9293
}

src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,8 @@ impl Token {
198198
Self(rand::thread_rng().gen())
199199
}
200200

201-
pub(crate) fn serialize(&self) -> Vec<u8> {
202-
format!("{}", self.0).into_bytes()
201+
pub(crate) fn serialize(&self) -> String {
202+
format!("{}", self.0)
203203
}
204204
}
205205

0 commit comments

Comments
 (0)