From ef97bded35e57bf6654e57ce26e3471a5e495e6c Mon Sep 17 00:00:00 2001 From: Amit Upadhyay Date: Sun, 8 Dec 2024 20:18:23 +0530 Subject: [PATCH] we start asking for FASTN.ftd file --- v0.5/fastn-continuation/src/result.rs | 6 ++++++ v0.5/fastn-package/src/reader.rs | 12 ++---------- v0.5/fastn-router/src/reader.rs | 4 ++-- 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/v0.5/fastn-continuation/src/result.rs b/v0.5/fastn-continuation/src/result.rs index 543ce9a8e..d0b80ea73 100644 --- a/v0.5/fastn-continuation/src/result.rs +++ b/v0.5/fastn-continuation/src/result.rs @@ -4,6 +4,12 @@ pub enum Result { Done(C::Output), } +impl Default for Result { + fn default() -> Self { + Result::Init(Box::default()) + } +} + impl Result where C::Found: Default, diff --git a/v0.5/fastn-package/src/reader.rs b/v0.5/fastn-package/src/reader.rs index 292c8969a..e3d771400 100644 --- a/v0.5/fastn-package/src/reader.rs +++ b/v0.5/fastn-package/src/reader.rs @@ -1,4 +1,4 @@ -#[derive(Debug)] +#[derive(Debug, Default)] pub struct State { name: String, systems: Vec>, @@ -8,16 +8,8 @@ pub struct State { } impl fastn_package::Package { - // s: FASTN.ftd source code pub fn reader() -> fastn_continuation::Result { - // TODO: lets make as much progress as we can - fastn_continuation::Result::Init(Box::new(State { - name: "".to_string(), - systems: vec![], - dependencies: vec![], - auto_imports: vec![], - apps: vec![], - })) + fastn_continuation::Result::Stuck(Default::default(), vec!["FASTN.ftd".to_string()]) } } diff --git a/v0.5/fastn-router/src/reader.rs b/v0.5/fastn-router/src/reader.rs index fe968cd96..dd66bac27 100644 --- a/v0.5/fastn-router/src/reader.rs +++ b/v0.5/fastn-router/src/reader.rs @@ -1,9 +1,9 @@ +#[derive(Default)] pub struct State {} impl fastn_router::Router { pub fn reader() -> fastn_continuation::Result { - // TODO: lets make as much progress as we can - fastn_continuation::Result::Stuck(Box::new(State {}), Default::default()) + fastn_continuation::Result::Stuck(Default::default(), vec!["FASTN.ftd".to_string()]) } }