remove some allow annotions and fix resulting warnings

This commit is contained in:
2019-05-07 17:46:17 +02:00
parent cd5e69145f
commit 66fc54cb3e
11 changed files with 20 additions and 33 deletions

View File

@ -1 +0,0 @@
use crate::model::*;

View File

@ -3,7 +3,7 @@ use super::*;
use std::io::*;
use std::net::*;
use serde::{Deserialize, Serialize};
use serde::Serialize;
pub struct Connection<R: Read + Sized, W: Write + Sized> {
reader: R,
@ -139,9 +139,9 @@ impl<R: Read + Sized, W: Write + Sized> Connection<R, W> {
_ => (), // else try other
}
let json: Command = serde_json::from_slice(&payload[..]).map_err(|e| {
let json: Command = serde_json::from_slice(&payload[..]).map_err(|_e| {
#[cfg(test)]
dbg!(&e);
dbg!(&_e);
Error::new(ErrorKind::InvalidData, "Invalid JSON.")
})?;

View File

@ -1,4 +1,3 @@
use std::io::*;
use std::net::*;
use std::thread;
@ -105,7 +104,7 @@ where
Ok(ReplaceTextureStatus::Ok) => {
connection.send(&Package::Json(JsonValue::True))?;
}
Ok(ReplaceTextureStatus::NeedTextureData(hash)) => {
Ok(ReplaceTextureStatus::NeedTextureData(_hash)) => {
panic!("Contract Violation: handler must not return NeedTextureData \
when data is given.");
}

View File

@ -46,8 +46,6 @@ pub enum Command {
},
}
use super::error::*;
impl From<ProtocolError> for Package {
fn from(item: ProtocolError) -> Self {
match item {

View File

@ -1,13 +1,9 @@
mod error;
pub use self::error::*;
mod implementation;
pub use self::implementation::*;
use crate::model::*;
use std::io;
use std::sync::Arc;
pub trait ProtocolHandler: Send + Sync + Clone {
fn query(&mut self, query: &[String]) -> ProtocolResult<Vec<Texture>>;