Compare commits

..

1 commit

Author SHA1 Message Date
b20052269f Style 2020-10-18 21:46:11 +02:00
4 changed files with 12 additions and 9 deletions

View file

@ -32,6 +32,7 @@ where
macro_rules! runnable_for_tuple {
( $($name:ident)* ) => (
#[allow(clippy::let_unit_value)]
#[async_trait(?Send)]
#[allow(non_snake_case)]
impl<$($name: Symbol + Debug,)*> Runnable for ($($name,)*) {
@ -117,7 +118,7 @@ mod test {
async fn run_symbol<S: Symbol + Debug, L: Logger>(
&self,
symbol: &S,
logger: &L,
_logger: &L,
force: bool,
) -> Result<bool, Box<dyn Error>> {
let run = force || !symbol.target_reached().await?;

View file

@ -201,7 +201,7 @@ mod test {
async fn run_symbol<S: Symbol + Debug, L: Logger>(
&self,
symbol: &S,
logger: &L,
_logger: &L,
force: bool,
) -> Result<bool, Box<dyn Error>> {
let run = force || !symbol.target_reached().await?;
@ -239,7 +239,7 @@ mod test {
#[derive(Clone)]
struct Artifacts;
impl<V> FromArtifact<TestResource<V>> for Artifacts {
fn from_artifact(from: ()) -> Self {
fn from_artifact(_from: ()) -> Self {
Self
}
fn into_artifact(self) -> () {

View file

@ -63,7 +63,12 @@ impl<C: CommandRunner, _C: Borrow<C>, P: AsRef<Path>, S: AsRef<str>, B: AsRef<st
}
async fn execute(&self) -> Result<(), Box<dyn Error>> {
if !self.target.as_ref().exists() {
if self.target.as_ref().exists() {
self
.run_git(&["fetch", self.source.as_ref(), self.branch.as_ref()])
.await?;
self.run_git(&["merge", "FETCH_HEAD"]).await?;
} else {
self
.command_runner
.borrow()
@ -80,11 +85,6 @@ impl<C: CommandRunner, _C: Borrow<C>, P: AsRef<Path>, S: AsRef<str>, B: AsRef<st
],
)
.await?;
} else {
self
.run_git(&["fetch", self.source.as_ref(), self.branch.as_ref()])
.await?;
self.run_git(&["merge", "FETCH_HEAD"]).await?;
}
Ok(())
}

View file

@ -17,6 +17,8 @@ macro_rules! to_artifact {
for_each_tuple!(to_artifact);
impl<T: Resource> ToArtifact for Option<T> {
// FIXME: https://github.com/rust-lang/rust-clippy/issues/2843
#![allow(clippy::use_self)]
type Artifact = Option<T::Artifact>;
}