Update File Symbol, add tests
This commit is contained in:
parent
301b39a80a
commit
55f2cfae95
4 changed files with 126 additions and 57 deletions
|
|
@ -6,7 +6,6 @@ use std::ops::Deref;
|
|||
use command_runner::CommandRunner;
|
||||
use symbols::Symbol;
|
||||
use symbols::file::File as FileSymbol;
|
||||
use symbols::file::FileError;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub enum NginxServerError<E: Error> {
|
||||
|
|
@ -14,18 +13,12 @@ pub enum NginxServerError<E: Error> {
|
|||
GenericError
|
||||
}
|
||||
|
||||
impl<E: Error> From<FileError<E>> for NginxServerError<FileError<E>> {
|
||||
fn from(err: FileError<E>) -> NginxServerError<FileError<E>> {
|
||||
impl From<io::Error> for NginxServerError<io::Error> {
|
||||
fn from(err: io::Error) -> NginxServerError<io::Error> {
|
||||
NginxServerError::ExecError(err)
|
||||
}
|
||||
}
|
||||
|
||||
impl<E: Error> From<io::Error> for NginxServerError<FileError<E>> {
|
||||
fn from(err: io::Error) -> NginxServerError<FileError<E>> {
|
||||
NginxServerError::GenericError
|
||||
}
|
||||
}
|
||||
|
||||
impl<E: Error> Error for NginxServerError<E> {
|
||||
fn description(&self) -> &str {
|
||||
match self {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue