Skip to content

ScreenWithStyles is returned by Screen::with_styles but cannot be named outside the crate #332

Description

@vyncint

TodayScreen::with_styles() returns ScreenWithStyles<'_> (screen.rs:1867). The type is pub (screen.rs:2037) but lives in the private mod screen (lib.rs:114) and is not in the crate's re-export list (lib.rs:127). It is therefore reachable but unnameable from outside the crate: a consumer can call .with_styles() and pass the result straight to insta, but cannot store it in a struct field, return it from a helper, or write fn f(s: ScreenWithStyles).

Fix. Add ScreenWithStyles to pub use screen::{…} with a one-line doc pointing at Screen::with_styles. Additive.

Done when

  • termlens::ScreenWithStyles names the type from a consumer crate (a doctest proves it).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions