Skip to content

Commit c4fa1c8

Browse files
committed
More frontend changes
1 parent 1ac5518 commit c4fa1c8

File tree

1 file changed

+6
-14
lines changed

1 file changed

+6
-14
lines changed

src/message/frontend.rs

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -192,22 +192,14 @@ pub fn startup_message<'a, I>(parameters: I, buf: &mut Vec<u8>) -> io::Result<()
192192
})
193193
}
194194

195-
pub struct Sync;
196-
197-
impl Message for Sync {
198-
fn write(&self, buf: &mut Vec<u8>) -> Result<(), io::Error> {
199-
buf.push(b'S');
200-
write_body(buf, |_| Ok(()))
201-
}
195+
pub fn sync(buf: &mut Vec<u8>) {
196+
buf.push(b'S');
197+
write_body(buf, |_| Ok::<(), io::Error>(())).unwrap();
202198
}
203199

204-
pub struct Terminate;
205-
206-
impl Message for Terminate {
207-
fn write(&self, buf: &mut Vec<u8>) -> Result<(), io::Error> {
208-
buf.push(b'X');
209-
write_body(buf, |_| Ok(()))
210-
}
200+
pub fn terminate(buf: &mut Vec<u8>) {
201+
buf.push(b'X');
202+
write_body(buf, |_| Ok::<(), io::Error>(())).unwrap();
211203
}
212204

213205
trait WriteCStr {

0 commit comments

Comments
 (0)