Format and clippy
This commit is contained in:
parent
466b4cb994
commit
bc4a898c0a
12 changed files with 17 additions and 27 deletions
|
|
@ -7,7 +7,8 @@
|
||||||
unused_extern_crates,
|
unused_extern_crates,
|
||||||
unused_import_braces,
|
unused_import_braces,
|
||||||
unused_qualifications,
|
unused_qualifications,
|
||||||
variant_size_differences
|
variant_size_differences,
|
||||||
|
clippy::use_self
|
||||||
)]
|
)]
|
||||||
#![warn(unused_results)]
|
#![warn(unused_results)]
|
||||||
/*
|
/*
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ pub struct Resource(pub String, pub String);
|
||||||
|
|
||||||
impl<'a> Resource {
|
impl<'a> Resource {
|
||||||
pub fn new<A: Into<String>, B: Into<String>>(rtype: A, value: B) -> Self {
|
pub fn new<A: Into<String>, B: Into<String>>(rtype: A, value: B) -> Self {
|
||||||
Resource(rtype.into(), value.into())
|
Self(rtype.into(), value.into())
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn get_type(&self) -> &str {
|
pub fn get_type(&self) -> &str {
|
||||||
|
|
|
||||||
|
|
@ -144,7 +144,7 @@ where
|
||||||
R: SymbolRunner,
|
R: SymbolRunner,
|
||||||
{
|
{
|
||||||
pub fn new(symbol_runner: R) -> Self {
|
pub fn new(symbol_runner: R) -> Self {
|
||||||
NonRepeatingSymbolRunner {
|
Self {
|
||||||
upstream: symbol_runner,
|
upstream: symbol_runner,
|
||||||
done: RefCell::new(HashSet::new()),
|
done: RefCell::new(HashSet::new()),
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ pub struct SimpleStorage(String, String);
|
||||||
|
|
||||||
impl SimpleStorage {
|
impl SimpleStorage {
|
||||||
pub fn new(base: String, filename: String) -> Self {
|
pub fn new(base: String, filename: String) -> Self {
|
||||||
SimpleStorage(base, filename)
|
Self(base, filename)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn get_path(&self, date: Option<u64>) -> String {
|
fn get_path(&self, date: Option<u64>) -> String {
|
||||||
|
|
|
||||||
|
|
@ -18,17 +18,9 @@ pub fn new<'a, R: CommandRunner, C: 'a + AsRef<str>, U: 'a + AsRef<str> + Clone,
|
||||||
let account_key_file = path("account.key");
|
let account_key_file = path("account.key");
|
||||||
List::from((
|
List::from((
|
||||||
AcmeAccountKey::new(account_key_file.clone(), command_runner),
|
AcmeAccountKey::new(account_key_file.clone(), command_runner),
|
||||||
Owner::new(
|
Owner::new(account_key_file, user_name.clone(), command_runner),
|
||||||
account_key_file,
|
|
||||||
user_name.clone(),
|
|
||||||
command_runner,
|
|
||||||
),
|
|
||||||
Dir::new(path("challenges")),
|
Dir::new(path("challenges")),
|
||||||
Owner::new(
|
Owner::new(path("challenges"), user_name.clone(), command_runner),
|
||||||
path("challenges"),
|
|
||||||
user_name.clone(),
|
|
||||||
command_runner,
|
|
||||||
),
|
|
||||||
Dir::new("/etc/ssl/local_certs"),
|
Dir::new("/etc/ssl/local_certs"),
|
||||||
Owner::new("/etc/ssl/local_certs", user_name, command_runner),
|
Owner::new("/etc/ssl/local_certs", user_name, command_runner),
|
||||||
File::new(path("lets_encrypt_x3_cross_signed.pem"), cert),
|
File::new(path("lets_encrypt_x3_cross_signed.pem"), cert),
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ pub struct Dir<D: AsRef<Path>> {
|
||||||
|
|
||||||
impl<D: AsRef<Path>> Dir<D> {
|
impl<D: AsRef<Path>> Dir<D> {
|
||||||
pub fn new(path: D) -> Self {
|
pub fn new(path: D) -> Self {
|
||||||
Dir { path }
|
Self { path }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
use std::borrow::Cow;
|
use std::borrow::Cow;
|
||||||
|
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ pub struct File<C: AsRef<str>, D: AsRef<Path>> {
|
||||||
|
|
||||||
impl<C: AsRef<str>, D: AsRef<Path>> File<C, D> {
|
impl<C: AsRef<str>, D: AsRef<Path>> File<C, D> {
|
||||||
pub fn new(path: D, content: C) -> Self {
|
pub fn new(path: D, content: C) -> Self {
|
||||||
File { path, content }
|
Self { path, content }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ where
|
||||||
B: Symbol,
|
B: Symbol,
|
||||||
{
|
{
|
||||||
pub fn new(a: A, b: B) -> Self {
|
pub fn new(a: A, b: B) -> Self {
|
||||||
Hook { a, b }
|
Self { a, b }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ pub enum NginxServerError<E: Error> {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl From<io::Error> for NginxServerError<io::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)
|
NginxServerError::ExecError(err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -23,8 +23,8 @@ impl From<io::Error> for NginxServerError<io::Error> {
|
||||||
impl<E: Error> Error for NginxServerError<E> {
|
impl<E: Error> Error for NginxServerError<E> {
|
||||||
fn description(&self) -> &str {
|
fn description(&self) -> &str {
|
||||||
match self {
|
match self {
|
||||||
NginxServerError::ExecError(ref e) => e.description(),
|
Self::ExecError(ref e) => e.description(),
|
||||||
NginxServerError::GenericError => "Generic error",
|
Self::GenericError => "Generic error",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fn cause(&self) -> Option<&dyn 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,
|
socket_path: SOCKET,
|
||||||
static_path: STATIC,
|
static_path: STATIC,
|
||||||
) -> String {
|
) -> String {
|
||||||
|
|
@ -109,7 +109,7 @@ pub struct LocalTcpSocket(usize);
|
||||||
|
|
||||||
impl LocalTcpSocket {
|
impl LocalTcpSocket {
|
||||||
pub fn new(x: usize) -> Self {
|
pub fn new(x: usize) -> Self {
|
||||||
LocalTcpSocket(x)
|
Self(x)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
use std::error::Error;
|
use std::error::Error;
|
||||||
|
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@ use std::error::Error;
|
||||||
use std::ffi::OsStr;
|
use std::ffi::OsStr;
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
use std::io;
|
use std::io;
|
||||||
|
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
use std::process::Output;
|
use std::process::Output;
|
||||||
|
|
@ -23,8 +22,8 @@ pub enum UserServiceError<E: Error> {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl From<io::Error> for UserServiceError<io::Error> {
|
impl From<io::Error> for UserServiceError<io::Error> {
|
||||||
fn from(err: io::Error) -> UserServiceError<io::Error> {
|
fn from(err: io::Error) -> Self {
|
||||||
UserServiceError::ExecError(err)
|
Self::ExecError(err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue