Fix warnings
This commit is contained in:
@@ -7,6 +7,7 @@ edition = "2018"
|
||||
[dependencies]
|
||||
hyper = { version = "0.14", features = ["http1", "http2", "client", "server", "tcp"] }
|
||||
http = "0.2"
|
||||
tokio = { version = "1.5.0", features = ["rt-multi-thread", "io-util", "net", "time", "sync", "fs"] }
|
||||
serde_json = "1.0"
|
||||
async-channel = "1.6"
|
||||
chrono = { version = "0.4.19", features = ["serde"] }
|
||||
|
||||
@@ -2,6 +2,7 @@ use nom::error::ErrorKind;
|
||||
use std::fmt::Debug;
|
||||
use std::num::ParseIntError;
|
||||
use std::string::FromUtf8Error;
|
||||
use tokio::task::JoinError;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct Error {
|
||||
@@ -82,28 +83,31 @@ impl From<FromUtf8Error> for Error {
|
||||
}
|
||||
}
|
||||
|
||||
impl<T> From<nom::Err<T>> for Error {
|
||||
impl<T: Debug> From<nom::Err<T>> for Error {
|
||||
fn from(k: nom::Err<T>) -> Self {
|
||||
Self {
|
||||
msg: format!("nom::Err<T>"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<I> From<nom::error::VerboseError<I>> for Error {
|
||||
fn from(k: nom::error::VerboseError<I>) -> Self {
|
||||
Self {
|
||||
msg: format!("nom::error::VerboseError<I>"),
|
||||
}
|
||||
Self::with_msg(format!("nom::Err<T> {:?}", k))
|
||||
}
|
||||
}
|
||||
|
||||
impl<I> nom::error::ParseError<I> for Error {
|
||||
fn from_error_kind(input: I, kind: ErrorKind) -> Self {
|
||||
todo!()
|
||||
fn from_error_kind(_input: I, kind: ErrorKind) -> Self {
|
||||
Self::with_msg(format!("ParseError {:?}", kind))
|
||||
}
|
||||
|
||||
fn append(input: I, kind: ErrorKind, other: Self) -> Self {
|
||||
todo!()
|
||||
fn append(_input: I, kind: ErrorKind, other: Self) -> Self {
|
||||
Self::with_msg(format!("ParseError kind {:?} other {:?}", kind, other))
|
||||
}
|
||||
}
|
||||
|
||||
impl From<JoinError> for Error {
|
||||
fn from(k: JoinError) -> Self {
|
||||
Self::with_msg(format!("JoinError {:?}", k))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn todoval<T>() -> T {
|
||||
if true {
|
||||
todo!("TODO todoval");
|
||||
}
|
||||
todo!()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user