Cargo fix
This commit is contained in:
parent
5505c09db4
commit
9bab810b91
38 changed files with 235 additions and 235 deletions
|
|
@ -10,7 +10,7 @@ use symbols::{Action, OwnedSymbolAction, Symbol, SymbolAction, SymbolRunner};
|
|||
pub enum UserAdderError {
|
||||
AlreadyExists,
|
||||
UnknownError,
|
||||
ImplError(Box<Error>)
|
||||
ImplError(Box<dyn Error>)
|
||||
}
|
||||
|
||||
impl Error for UserAdderError {
|
||||
|
|
@ -21,7 +21,7 @@ impl Error for UserAdderError {
|
|||
UserAdderError::ImplError(_) => "User adding error"
|
||||
}
|
||||
}
|
||||
fn cause(&self) -> Option<&Error> {
|
||||
fn cause(&self) -> Option<&dyn Error> {
|
||||
match self {
|
||||
UserAdderError::ImplError(ref e) => Some(e.as_ref()),
|
||||
_ => None
|
||||
|
|
@ -53,7 +53,7 @@ impl Error for UserError {
|
|||
UserError::GenericError => "Could not find out if user exists"
|
||||
}
|
||||
}
|
||||
fn cause(&self) -> Option<&Error> {
|
||||
fn cause(&self) -> Option<&dyn Error> {
|
||||
match self {
|
||||
_ => None
|
||||
}
|
||||
|
|
@ -88,7 +88,7 @@ impl<'a, C: CommandRunner, A: 'a + UserAdder> fmt::Display for User<'a, C, A> {
|
|||
}
|
||||
|
||||
impl<'a, C: CommandRunner, A: 'a + UserAdder> Symbol for User<'a, C, A> {
|
||||
fn target_reached(&self) -> Result<bool, Box<Error>> {
|
||||
fn target_reached(&self) -> Result<bool, Box<dyn Error>> {
|
||||
let output = try!(self.command_runner.run_with_args("getent", &["passwd", &*self.user_name]));
|
||||
match output.status.code() {
|
||||
Some(2) => Ok(false),
|
||||
|
|
@ -97,19 +97,19 @@ impl<'a, C: CommandRunner, A: 'a + UserAdder> Symbol for User<'a, C, A> {
|
|||
}
|
||||
}
|
||||
|
||||
fn execute(&self) -> Result<(), Box<Error>> {
|
||||
self.user_adder.add_user(&*self.user_name).map_err(|e| Box::new(e) as Box<Error>)
|
||||
fn execute(&self) -> Result<(), Box<dyn Error>> {
|
||||
self.user_adder.add_user(&*self.user_name).map_err(|e| Box::new(e) as Box<dyn Error>)
|
||||
}
|
||||
|
||||
fn provides(&self) -> Option<Vec<Resource>> {
|
||||
Some(vec![Resource::new("user", self.user_name.to_string())])
|
||||
}
|
||||
|
||||
fn as_action<'b>(&'b self, runner: &'b SymbolRunner) -> Box<Action + 'b> {
|
||||
fn as_action<'b>(&'b self, runner: &'b dyn SymbolRunner) -> Box<dyn Action + 'b> {
|
||||
Box::new(SymbolAction::new(runner, self))
|
||||
}
|
||||
|
||||
fn into_action<'b>(self: Box<Self>, runner: &'b SymbolRunner) -> Box<Action + 'b> where Self: 'b {
|
||||
fn into_action<'b>(self: Box<Self>, runner: &'b dyn SymbolRunner) -> Box<dyn Action + 'b> where Self: 'b {
|
||||
Box::new(OwnedSymbolAction::new(runner, *self))
|
||||
}
|
||||
}
|
||||
|
|
@ -183,7 +183,7 @@ mod test {
|
|||
struct DummyUserAdder;
|
||||
|
||||
impl UserAdder for DummyUserAdder {
|
||||
fn add_user(&self, user_name: &str) -> Result<(), UserAdderError> {
|
||||
fn add_user(&self, _user_name: &str) -> Result<(), UserAdderError> {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue