Skip to content

README quick-start example does not compile against the current API #2

Description

@wan0net

Summary
The README usage section appears out of sync with the actual crate API.

What I found

  • README.md uses UiTree::new() with no arguments
  • src/tree.rs defines UiTree::new(root_widget: Widget)
  • README.md also uses Widget::label(...) and Widget::button(...)
  • src/widget.rs does not define those constructors

Why this matters
A non-working quick-start example makes the crate look broken even when the library code may be fine. It is especially costly in an alpha project where the README is doing most of the onboarding work.

Suggested fix

  • Update the README to use the current API, or
  • Add the missing convenience constructors if the README is the intended API surface
  • Consider adding a doc test or CI check that exercises the README example so it stays in sync

Acceptance criteria

  • The README usage example compiles against the current crate
  • The example reflects the actual constructor pattern for UiTree and widgets
  • A regression check exists so future README drift is caught automatically

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions