fix(cli): add pinocchio to Framework::FromStr and replace todo!() with unimplemented!()#689
fix(cli): add pinocchio to Framework::FromStr and replace todo!() with unimplemented!()#689gamandeepsingh wants to merge 2 commits into
Conversation
Greptile SummaryThis PR fixes two bugs in
Confidence Score: 5/5Safe to merge — the changes are minimal, targeted, and correct. Both fixes are straightforward: the missing "pinocchio" arm in FromStr now matches the existing Display impl and enum variant, and the unimplemented!() replacements carry clearer diagnostic messages. No logic is altered for any working framework path, and the Typhoon path was already a panic regardless. No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["CLI: --framework <value>"] --> B["Framework::from_str(s)"]
B --> C{"match s.to_lowercase()"}
C -->|"anchor"| D[Framework::Anchor]
C -->|"native"| E[Framework::Native]
C -->|"steel"| F[Framework::Steel]
C -->|"pinocchio"| G["Framework::Pinocchio (added)"]
C -->|"typhoon"| H[Framework::Typhoon]
C -->|"_"| I["Err: Unknown framework"]
D & E & F & G --> J["get_interpolated_program_deployment_template()"]
H --> K["unimplemented!() (was todo!())"]
J --> L["Returns template String"]
Reviews (1): Last reviewed commit: "Refactor: Ran fmt command" | Re-trigger Greptile |
MicaiahReid
left a comment
There was a problem hiding this comment.
Good find, thanks @gamandeepsingh!
Problem
Framework::FromStrincrates/cli/src/types/mod.rshad two issues:"pinocchio"was missing from the match, so--framework pinocchioalwaysreturned
Unknown framework: pinocchioeven thoughFramework::Pinocchiois fully implemented everywhere else.
Typhoonarms in both template methods usedtodo!(), which gives amisleading "not yet implemented" panic with no context.
Changes
"pinocchio" => Ok(Framework::Pinocchio)toFromStrtodo!()withunimplemented!("Typhoon framework templates are not yet implemented")in both
get_interpolated_program_deployment_templateandget_in_memory_interpolated_program_deployment_templateWhy
unimplemented!()overtodo!()todo!()implies the code is actively being worked on.unimplemented!()correctly signals that this feature doesn't exist yet,giving a clear message if someone calls it instead of a bare panic.
Test plan
cargo test -p surfpool-cli— 18/18 passingcargo +nightly fmt --all -- --check— cleancargo check -p surfpool-cli— cleancargo clippy --all-targets— 0 new warnings (pre-existing warnings unrelated to this change)Closes #688