diff --git a/src/arg_handler.rs b/src/arg_handler.rs index 5ad3780..6080c02 100644 --- a/src/arg_handler.rs +++ b/src/arg_handler.rs @@ -112,14 +112,14 @@ impl<'a: 'b, 'b> ArgHandler<'a> { pub fn size(&self, def: Option<(u32, u32)>) -> (u32, u32) { ( self.matches.value_of("width") - .map(|width| width.parse::() + .map(|width| width.parse() .expect("Invalid image width") ) .unwrap_or( def.expect("No screen width set or known").0 ), self.matches.value_of("height") - .map(|height| height.parse::() + .map(|height| height.parse() .expect("Invalid image height") ) .unwrap_or( diff --git a/src/pix/client.rs b/src/pix/client.rs index d93d140..e42ec0d 100644 --- a/src/pix/client.rs +++ b/src/pix/client.rs @@ -117,6 +117,13 @@ impl Client { } } +impl Drop for Client { + /// Nicely drop the connection when the client is disconnected. + fn drop(&mut self) { + let _ = self.write_command("\r\nQUIT".into()); + } +} + /// Create a stream to talk to the pixelflut server.