We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2871a13 commit bc20da4Copy full SHA for bc20da4
src/inner.rs
@@ -83,10 +83,11 @@ async fn mainloop(
83
};
84
85
let mut input = token.serialize();
86
- input.extend_from_slice(msg.as_bytes());
87
- input.push(b'\n');
+ input.push_str(&msg);
+ input.push('\n');
88
89
- if let Err(err) = stdin.write_all(&input).await {
+ debug!("Sending {}", input);
90
+ if let Err(err) = stdin.write_all(&input.as_bytes()).await {
91
error!("Failed to write, stopping: {}", err);
92
break;
93
}
src/lib.rs
@@ -198,8 +198,8 @@ impl Token {
198
Self(rand::thread_rng().gen())
199
200
201
- pub(crate) fn serialize(&self) -> Vec<u8> {
202
- format!("{}", self.0).into_bytes()
+ pub(crate) fn serialize(&self) -> String {
+ format!("{}", self.0)
203
204
205
0 commit comments