Compare commits

..

1 commit

Author SHA1 Message Date
0d836b899f Style 2020-10-17 23:58:31 +02:00
4 changed files with 9 additions and 12 deletions

View file

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

View file

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

View file

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

View file

@ -17,8 +17,6 @@ macro_rules! to_artifact {
for_each_tuple!(to_artifact); for_each_tuple!(to_artifact);
impl<T: Resource> ToArtifact for Option<T> { 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>; type Artifact = Option<T::Artifact>;
} }