Add a proper error type to ContinuallyRan

This isn't necessary. Because we just log the error, we never match off of it,
we don't need any structure beyond String (or now Debug, which still gives us
a way to print the error). This is for the ergonomics of not having to
constantly write `.map_err(|e| format!("{e:?}"))`.
This commit is contained in:
Luke Parker
2025-01-12 18:29:08 -05:00
parent 3cc2abfedc
commit b5a6b0693e
26 changed files with 126 additions and 56 deletions

View File

@@ -32,7 +32,8 @@ pub(crate) struct SubstrateTask<P: P2p> {
}
impl<P: P2p> ContinuallyRan for SubstrateTask<P> {
fn run_iteration(&mut self) -> impl Send + Future<Output = Result<bool, String>> {
type Error = String; // TODO
fn run_iteration(&mut self) -> impl Send + Future<Output = Result<bool, Self::Error>> {
async move {
let mut made_progress = false;