cleanup run function
This commit is contained in:
parent
60404db64e
commit
5c63f63e2a
@ -98,10 +98,7 @@ impl Sway {
|
|||||||
self.run("get_seats", IPC_GET_SEATS)
|
self.run("get_seats", IPC_GET_SEATS)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn run<T>(&mut self, payload: &str, payload_type: u32) -> Result<T>
|
fn run<T: DeserializeOwned>(&mut self, payload: &str, payload_type: u32) -> Result<T> {
|
||||||
where
|
|
||||||
T: DeserializeOwned,
|
|
||||||
{
|
|
||||||
let buffer = I3msg::new(payload, payload_type).construct_packet()?;
|
let buffer = I3msg::new(payload, payload_type).construct_packet()?;
|
||||||
self.stream.write_all(&buffer.as_slice())?;
|
self.stream.write_all(&buffer.as_slice())?;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user