remove some allow annotions and fix resulting warnings
This commit is contained in:
@ -1 +0,0 @@
|
||||
use crate::model::*;
|
@ -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.")
|
||||
})?;
|
||||
|
@ -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.");
|
||||
}
|
||||
|
@ -46,8 +46,6 @@ pub enum Command {
|
||||
},
|
||||
}
|
||||
|
||||
use super::error::*;
|
||||
|
||||
impl From<ProtocolError> for Package {
|
||||
fn from(item: ProtocolError) -> Self {
|
||||
match item {
|
||||
|
@ -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>>;
|
||||
|
Reference in New Issue
Block a user