diff options
| author | Eskil Queseth <eskilq@kth.se> | 2021-03-29 00:45:09 +0200 |
|---|---|---|
| committer | Eskil Queseth <eskilq@kth.se> | 2021-03-29 00:45:09 +0200 |
| commit | 0e56945163d1447b2127f5499f6b897b41271d40 (patch) | |
| tree | 3b8f4b920fb168f24980460d926949bbc03db07a /mumctl/src/main.rs | |
| parent | bb81c02ddf4f9cc6ab0dbceea890e1be06fdbcf0 (diff) | |
| download | mum-0e56945163d1447b2127f5499f6b897b41271d40.tar.gz | |
update according to feedback
Diffstat (limited to 'mumctl/src/main.rs')
| -rw-r--r-- | mumctl/src/main.rs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/mumctl/src/main.rs b/mumctl/src/main.rs index 0b948c0..9d9e4fd 100644 --- a/mumctl/src/main.rs +++ b/mumctl/src/main.rs @@ -610,7 +610,7 @@ fn parse_status(server_state: &mumlib::state::Server) { } fn send_command(command: Command) -> Result<mumlib::error::Result<Option<CommandResponse>>, crate::Error> { - let mut connection = UnixStream::connect("/tmp/mumd").map_err(|_| Error::ConnectionError)?; + let mut connection = UnixStream::connect(mumlib::SOCKET_PATH).map_err(|_| Error::ConnectionError)?; let serialized = bincode::serialize(&command).unwrap(); @@ -618,9 +618,7 @@ fn send_command(command: Command) -> Result<mumlib::error::Result<Option<Command connection.write(&serialized).map_err(|_| Error::ConnectionError)?; connection.read_exact(&mut [0; 4]).map_err(|_| Error::ConnectionError)?; - let response = bincode::deserialize_from(&mut connection).map_err(|_| Error::ConnectionError)?; - - Ok(response) + bincode::deserialize_from(&mut connection).map_err(|_| Error::ConnectionError) } fn print_channel(channel: &Channel, depth: usize) { |
