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 { 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,)*) {
@ -117,7 +118,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,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>> { 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()
@ -80,11 +85,6 @@ 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,6 +17,8 @@ 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>;
} }