Radish alpha
r
rad:z2UcCU1LgMshWvXj6hXSDDrwB8q8M
Radicle Job Collaborative Object
Radicle
Git
fix: infallible `action`
Fintan Halpenny committed 10 months ago
commit e917ef069e1214e80eba2d3c6bd228a3bd889091
parent f9d9f1f
1 file changed +4 -6
modified src/lib.rs
@@ -344,18 +344,16 @@ impl Job {
        updated
    }

-
    fn action(&mut self, node: NodeId, action: Action) -> Result<(), error::Build> {
+
    fn action(&mut self, node: NodeId, action: Action) {
        match action {
            // Cannot request for another `oid`, so we ignore any superfluous
            // request actions
-
            Action::Request { .. } => Ok(()),
+
            Action::Request { .. } => {}
            Action::Run { uuid, log } => {
                self.insert(node, uuid, Run::new(log));
-
                Ok(())
            }
            Action::Finished { uuid, reason } => {
                self.update(node, uuid, reason);
-
                Ok(())
            }
        }
    }
@@ -380,7 +378,7 @@ impl store::Cob for Job {
            .map_err(|err| error::Build::MissingCommit { oid, err })?;
        let mut runs = Self::new(oid);
        for action in actions {
-
            runs.action(op.author, action)?;
+
            runs.action(op.author, action);
        }
        Ok(runs)
    }
@@ -392,7 +390,7 @@ impl store::Cob for Job {
        _repo: &R,
    ) -> Result<(), Self::Error> {
        for action in op.actions {
-
            self.action(op.author, action)?;
+
            self.action(op.author, action);
        }
        Ok(())
    }