We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 61245b1 commit 600d187Copy full SHA for 600d187
espflash/src/connection.rs
@@ -1,4 +1,8 @@
1
-use std::{io::Write, thread::sleep, time::Duration};
+use std::{
2
+ io::{BufWriter, Write},
3
+ thread::sleep,
4
+ time::Duration,
5
+};
6
7
use binread::{io::Cursor, BinRead, BinReaderExt};
8
use bytemuck::{Pod, Zeroable};
@@ -113,7 +117,8 @@ impl Connection {
113
117
}
114
118
115
119
pub fn write_command(&mut self, command: Command) -> Result<(), Error> {
116
- let mut encoder = SlipEncoder::new(&mut self.serial)?;
120
+ let mut writer = BufWriter::new(&mut self.serial);
121
+ let mut encoder = SlipEncoder::new(&mut writer)?;
122
command.write(&mut encoder)?;
123
encoder.finish()?;
124
Ok(())
0 commit comments