Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ListItem template SupportingText is optional, but can't use Option<SupportingText> #465

Open
sologeek opened this issue Nov 7, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@sologeek
Copy link
Contributor

sologeek commented Nov 7, 2023

fn w() -> impl WidgetBuilder {
  fn_widget! {
    let support_text = desc.map(|desc| {
      @SupportingText(Label::new(desc.to_owned()))
    });
    @ListItem {
      @HeadingText(Label::new(""))
      @ { supporting_text }
    }
  }
}
the trait bound `ListItemTmlBuilder: ribir::prelude::ComposeWithChild<std::option::Option<ribir::prelude::SupportingText>, _>` is not satisfied
the following other types implement trait `ribir::prelude::ComposeWithChild<C, M>`:
  <ListItemTmlBuilder as ribir::prelude::ComposeWithChild<_C, [_M; 0]>>
  <ListItemTmlBuilder as ribir::prelude::ComposeWithChild<_C, [_M; 1]>>
  <ListItemTmlBuilder as ribir::prelude::ComposeWithChild<_C, [_M; 2]>>
  <ListItemTmlBuilder as ribir::prelude::ComposeWithChild<_C, [_M; 3]>>
required for `ribir::prelude::Pair<ribir::prelude::State<ribir::prelude::ListItem>, ListItemTmlBuilder>` to implement `ribir::prelude::ComposeWithChild<std::option::Option<ribir::prelude::SupportingText>, _>`
1 redundant requirement hidden
required for `ribir::prelude::FatObj<ribir::prelude::Pair<ribir::prelude::State<ribir::prelude::ListItem>, ListItemTmlBuilder>>` to implement `ribir::prelude::ComposeWithChild<std::option::Option<ribir::prelude::SupportingText>, _>`
@sologeek sologeek added the bug Something isn't working label Nov 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant