Returning a `iced_widget`from a function makes my `Render` unknown

I’m Working on a widget and I made this function to cut down on the amount of code I needed

    fn layout_text<'a>(&'a self, text: &'a str, size: f32, font: Option<Font>) -> Text {

The problem is my return type Text<> I don’t care what Renderer it has I just want to return the widget.

Here is the solution you poor soul in the future

        fn layout_text<Renderer>(
            text: &str,
            size: f32,
            font: Option<Font>,
        ) -> Text<'_, Renderer>
            Renderer: iced_widget::core::text::Renderer,
            Renderer::Theme: iced_widget::text::StyleSheet,
            Renderer::Font: From<Font>,
1 Like

Remember that you can always look at the widget::helpers. There is no magic in the codebase.