diff options
author | 2024-08-22 02:24:06 +0200 | |
---|---|---|
committer | 2024-08-22 02:24:06 +0200 | |
commit | 4c883f12b4761c7e0b273d9a2380552336f61d96 (patch) | |
tree | e2ef505aaa87b84bad010a633a9a96891b50df7d /widget/src/helpers.rs | |
parent | 55764b923e69afa8a92b4a6cbd34ee9ddbf8a03d (diff) | |
download | iced-4c883f12b4761c7e0b273d9a2380552336f61d96.tar.gz iced-4c883f12b4761c7e0b273d9a2380552336f61d96.tar.bz2 iced-4c883f12b4761c7e0b273d9a2380552336f61d96.zip |
Make `RichText` generic over data structure
... and decouple `markdown::parse` from theming
Diffstat (limited to 'widget/src/helpers.rs')
-rw-r--r-- | widget/src/helpers.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/widget/src/helpers.rs b/widget/src/helpers.rs index c3ffea45..1cb02830 100644 --- a/widget/src/helpers.rs +++ b/widget/src/helpers.rs @@ -25,7 +25,7 @@ use crate::tooltip::{self, Tooltip}; use crate::vertical_slider::{self, VerticalSlider}; use crate::{Column, MouseArea, Row, Space, Stack, Themer}; -use std::borrow::{Borrow, Cow}; +use std::borrow::Borrow; use std::ops::RangeInclusive; /// Creates a [`Column`] with the given children. @@ -707,12 +707,13 @@ where /// /// [`Rich`]: text::Rich pub fn rich_text<'a, Link, Theme, Renderer>( - spans: impl Into<Cow<'a, [text::Span<'a, Link, Renderer::Font>]>>, + spans: impl AsRef<[text::Span<'a, Link, Renderer::Font>]> + 'a, ) -> text::Rich<'a, Link, Theme, Renderer> where Link: Clone + 'static, Theme: text::Catalog + 'a, Renderer: core::text::Renderer, + Renderer::Font: 'a, { text::Rich::with_spans(spans) } |