Skip to content

refactor: take paths and strings as they come, and add Birthmark::load - #218

Merged
tamada merged 2 commits into
mainfrom
refactor/extend-parameter-types
Oct 24, 2026
Merged

tamada merged 2 commits into
mainfrom
refactor/extend-parameter-types

Conversation

@tamada

@tamada tamada commented Oct 23, 2026

Copy link
Copy Markdown
Owner

Callers of the library pass paths and strings as they have them, rather than converting them first.

The library

  • Program::load and the new Birthmark::load take anything that is a path. Program::load("a.json") replaces Program::load(Path::new("a.json")), and a birthmark is read the same way a program is.
  • set_json_path, on both Program and Birthmark, takes anything that converts into a PathBuf.
  • Kgram::new takes any sequence of strings.

Code that passed the old types compiles unchanged.

Breaking: LifterBuilder

LifterBuilder::home, script and intermediate_dir take the value itself rather than an Option. A setting is left out by not calling its method, which keeps the default as before.

  • The command line keeps its single builder chain with set_if_some, which calls a setter only when its option was given.
  • v0.9.0's release notes gain an Upgrading from v0.8.x section for this, and a highlight for the rest.

public_api.sh no longer empties target/doc

Cargo empties target/doc whenever a different rustdoc writes to it. The script's pinned nightly therefore deleted the HTML documentation that the stable cargo doc had built, every time it ran. The script now builds in target/public-api.

Checked

  • cargo test --features mcp (413 tests), clippy with -D warnings and the public API check pass locally.
  • Each commit builds on its own.
  • target/doc survives a run of public_api.sh.

🤖 Generated with Claude Code

tamada and others added 2 commits October 23, 2026 08:43
Cargo empties target/doc whenever a different rustdoc writes to it, so the
pinned nightly that reads the public API deleted the HTML documentation the
stable `cargo doc` had built. The script now builds in target/public-api.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Program::load and the new Birthmark::load take anything that is a path, so
a caller passes a string or a PathBuf without wrapping it in Path::new.
set_json_path takes anything that converts into a PathBuf, and Kgram::new
any sequence of strings. The README, the crate docs and the tests pass
their values as they are.

LifterBuilder's home, script and intermediate_dir take the value itself
rather than an Option; a setting is left out by not calling its method. The
command line keeps its one chain with set_if_some, which calls a setter
only when its option was given.
@tamada tamada self-assigned this Oct 23, 2026
@tamada tamada added the enhancement New feature or request label Oct 23, 2026
@tamada tamada added this to the v0.9.0 milestone Oct 23, 2026
@sonarqubecloud

Copy link
Copy Markdown

@tamada
tamada merged commit bbe37f4 into main Oct 24, 2026
6 of 8 checks passed
@tamada
tamada deleted the refactor/extend-parameter-types branch October 24, 2026 09:15
@tamada
tamada restored the refactor/extend-parameter-types branch October 29, 2026 07:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant