Format and clippy

This commit is contained in:
Adrian Heine 2019-10-02 23:38:22 +02:00
parent 466b4cb994
commit bc4a898c0a
12 changed files with 17 additions and 27 deletions

View file

@ -15,7 +15,7 @@ pub enum NginxServerError<E: Error> {
}
impl From<io::Error> for NginxServerError<io::Error> {
fn from(err: io::Error) -> NginxServerError<io::Error> {
fn from(err: io::Error) -> Self {
NginxServerError::ExecError(err)
}
}
@ -23,8 +23,8 @@ impl From<io::Error> for NginxServerError<io::Error> {
impl<E: Error> Error for NginxServerError<E> {
fn description(&self) -> &str {
match self {
NginxServerError::ExecError(ref e) => e.description(),
NginxServerError::GenericError => "Generic error",
Self::ExecError(ref e) => e.description(),
Self::GenericError => "Generic error",
}
}
fn cause(&self) -> Option<&dyn Error> {
@ -75,7 +75,7 @@ server {{
)
}
pub fn php_server_config_snippet<'a, SOCKET: AsRef<Path>, STATIC: AsRef<Path>>(
pub fn php_server_config_snippet<SOCKET: AsRef<Path>, STATIC: AsRef<Path>>(
socket_path: SOCKET,
static_path: STATIC,
) -> String {
@ -109,7 +109,7 @@ pub struct LocalTcpSocket(usize);
impl LocalTcpSocket {
pub fn new(x: usize) -> Self {
LocalTcpSocket(x)
Self(x)
}
}