From ce4fd8ccc95747a1bd3212b627ffd5b36111aeba Mon Sep 17 00:00:00 2001 From: dzu Date: Fri, 13 Feb 2026 10:16:18 +0000 Subject: [PATCH 1/3] add hard-coded paths warning --- anode-build/src/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/anode-build/src/lib.rs b/anode-build/src/lib.rs index e91b6f1..e2d1f97 100644 --- a/anode-build/src/lib.rs +++ b/anode-build/src/lib.rs @@ -1,3 +1,4 @@ +// WARN: be aware that both source code file path and output path and hard-coded. they might not work for you; if you have any suggestion for heuristics would determine these paths in a universal way, please let me know use syn::{File, punctuated::Punctuated}; use anode_macros_input::pretty_span; From 44916a91dbe4b053baea05fb6986e6bc842288d9 Mon Sep 17 00:00:00 2001 From: dzu Date: Fri, 13 Feb 2026 10:17:50 +0000 Subject: [PATCH 2/3] remeve Forgejo-openapi from the workspace There is literally to reason to mingle them --- Cargo.toml | 2 -- anode/Cargo.toml | 4 ---- 2 files changed, 6 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index cb2ce28..6d43f1a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,8 +13,6 @@ anode = { path = "./anode" } anode-macros-input = { path = "./anode-macros-input" } anode-macros = { path = "./anode-macros" } anode-build = { path = "./anode-build" } -# git -forgejo-openapi = { git = "https://git.dzuchun.ing/dzu/forgejo-openapi.git", default-features = false } # crates.io syn = { version = "2", default-features = false } quote = { version = "1", default-features = false } diff --git a/anode/Cargo.toml b/anode/Cargo.toml index 3649d67..ca29a33 100644 --- a/anode/Cargo.toml +++ b/anode/Cargo.toml @@ -6,7 +6,3 @@ edition = "2024" [dependencies] anode-macros.workspace = true thiserror.workspace = true -forgejo-openapi = { workspace = true, optional = true } - -[features] -forge-forgejo = [ "dep:forgejo-openapi" ] From d9ad91c55dfb099ed1d8356c0f537402d6c99f1e Mon Sep 17 00:00:00 2001 From: dzu Date: Fri, 13 Feb 2026 14:06:58 +0000 Subject: [PATCH 3/3] add boolean parser --- anode/src/lib.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/anode/src/lib.rs b/anode/src/lib.rs index bda5cd6..fa916d4 100644 --- a/anode/src/lib.rs +++ b/anode/src/lib.rs @@ -70,6 +70,24 @@ pub mod __default_parser { pub fn PathBuf(input: OsString) -> Result { Ok(input.into()) } + + #[derive(Debug, thiserror::Error)] + #[error("Unknown boolean value: {}", _0.display())] + pub struct UnknownBoolean(OsString); + + pub fn bool(input: OsString) -> Result { + const VALID_TRUE: &[&[u8]] = &[b"TRUE", b"True", b"true", b"1"]; + const VALID_FALSE: &[&[u8]] = &[b"FALSE", b"False", b"false", b"0"]; + if VALID_TRUE.contains(&input.as_bytes()) { + return Ok(true); + } + + if VALID_FALSE.contains(&input.as_bytes()) { + return Ok(false); + } + + Err(UnknownBoolean(input)) + } } pub mod parse {