Use text::Span::new in window_manager
This commit is contained in:
parent
c83809adb9
commit
c9abe25d31
2 changed files with 27 additions and 52 deletions
|
|
@ -270,23 +270,6 @@ pub struct Span<'a, Link = (), Font = crate::Font> {
|
|||
pub strikethrough: bool,
|
||||
}
|
||||
|
||||
impl<Link, Font> Default for Span<'_, Link, Font> {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
text: Cow::default(),
|
||||
size: None,
|
||||
line_height: None,
|
||||
font: None,
|
||||
color: None,
|
||||
link: None,
|
||||
highlight: None,
|
||||
padding: Padding::default(),
|
||||
underline: false,
|
||||
strikethrough: false,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// A text highlight.
|
||||
#[derive(Debug, Clone, Copy, PartialEq)]
|
||||
pub struct Highlight {
|
||||
|
|
@ -301,15 +284,7 @@ impl<'a, Link, Font> Span<'a, Link, Font> {
|
|||
pub fn new(fragment: impl IntoFragment<'a>) -> Self {
|
||||
Self {
|
||||
text: fragment.into_fragment(),
|
||||
size: None,
|
||||
line_height: None,
|
||||
font: None,
|
||||
color: None,
|
||||
highlight: None,
|
||||
link: None,
|
||||
padding: Padding::ZERO,
|
||||
underline: false,
|
||||
strikethrough: false,
|
||||
..Self::default()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -457,6 +432,23 @@ impl<'a, Link, Font> Span<'a, Link, Font> {
|
|||
}
|
||||
}
|
||||
|
||||
impl<Link, Font> Default for Span<'_, Link, Font> {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
text: Cow::default(),
|
||||
size: None,
|
||||
line_height: None,
|
||||
font: None,
|
||||
color: None,
|
||||
link: None,
|
||||
highlight: None,
|
||||
padding: Padding::default(),
|
||||
underline: false,
|
||||
strikethrough: false,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, Link, Font> From<&'a str> for Span<'a, Link, Font> {
|
||||
fn from(value: &'a str) -> Self {
|
||||
Span::new(value)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue