Skip to content

feat(api)!: use bon to derive builder methods on core structs#322

Closed
Copilot wants to merge 6 commits intomasterfrom
copilot/use-bon-for-builder-function
Closed

feat(api)!: use bon to derive builder methods on core structs#322
Copilot wants to merge 6 commits intomasterfrom
copilot/use-bon-for-builder-function

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 28, 2026

  • Add bon crate dependency to Cargo.toml
  • Add #[derive(Builder)] to visualizer::Visualizer
  • Add #[derive(Builder)] to fs_tree_builder::FsTreeBuilder
  • Add #[derive(Builder)] to tree_builder::TreeBuilder
  • Add #[derive(Builder)] to app::sub::Sub
  • Update doc examples to use builder API
  • Update tests/_utils.rs to use FsTreeBuilder::builder()
  • Update tests/tree_builder.rs to use TreeBuilder::builder()
  • Update tests/visualizer.rs to use Visualizer::builder() in the test macro
  • Update tests/json.rs to use FsTreeBuilder::builder() and Visualizer::builder()
  • Update tests/cli_errors.rs to use FsTreeBuilder::builder() and Visualizer::builder()
  • Update tests/usual_cli.rs to use FsTreeBuilder::builder() and Visualizer::builder() (18 occurrences each)
  • Apply master branch updates (USAGE.md, src/usage_md.rs, cli/usage_md.rs, sync tests, updated exports)
  • Verify all tests pass
Original prompt

This section details on the original issue you should resolve

<issue_title>feat(api)!: use bon to convert some structs into a builder function</issue_title>
<issue_description>* [ ] app::sub::Sub

  • tree_builder::TreeBuilder
  • fs_tree_builder::FsTreeBuilder
  • visualizer::Visualizer</issue_description>

<agent_instructions>The repository: https://github.com/elastio/bon

The documentation: https://docs.rs/bon/latest/bon/

The crate page: https://crates.io/crates/bon

Use env DOC=true ./test.sh to run all tests, including documentation.</agent_instructions>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: KSXGitHub <11488886+KSXGitHub@users.noreply.github.com>
Copilot AI changed the title [WIP] Use bon to convert structs into builder functions feat(api)!: use bon to derive builder methods on core structs Feb 28, 2026
@KSXGitHub
Copy link
Copy Markdown
Owner

@copilot Does the test files also make use of these structs? If they do, I would like you to update them as well.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Feb 28, 2026

Performance Regression Reports

commit: c32d5e3

There are no regressions.

…Visualizer in test files

Co-authored-by: KSXGitHub <11488886+KSXGitHub@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Feb 28, 2026

@copilot Does the test files also make use of these structs? If they do, I would like you to update them as well.

Yes, the test files did use these structs. Updated all usages in commit 3cc45c5:

  • tests/_utils.rsFsTreeBuilder
  • tests/tree_builder.rsTreeBuilder
  • tests/visualizer.rsVisualizer (inside the test_case! macro)
  • tests/json.rsFsTreeBuilder and Visualizer
  • tests/cli_errors.rsFsTreeBuilder and Visualizer
  • tests/usual_cli.rsFsTreeBuilder and Visualizer (18 occurrences each)

@KSXGitHub
Copy link
Copy Markdown
Owner

@copilot The master branch has just been updated.

@KSXGitHub KSXGitHub force-pushed the copilot/use-bon-for-builder-function branch from d328df6 to 3645048 Compare February 28, 2026 20:18
@KSXGitHub
Copy link
Copy Markdown
Owner

Wrong idea.

@KSXGitHub KSXGitHub closed this Mar 1, 2026
@KSXGitHub KSXGitHub deleted the copilot/use-bon-for-builder-function branch March 1, 2026 09:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(api)!: use bon to convert some structs into a builder function

2 participants