mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-11-25 13:01:07 +00:00
textwrap: Remove workaround that is not needed anymore with textwrap 0.13.2
This commit is contained in:
parent
078bf81b85
commit
514f6ea7ec
2 changed files with 4 additions and 14 deletions
|
@ -10,7 +10,7 @@ repository = "https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs"
|
||||||
[dependencies]
|
[dependencies]
|
||||||
glib = { git = "https://github.com/gtk-rs/gtk-rs" }
|
glib = { git = "https://github.com/gtk-rs/gtk-rs" }
|
||||||
once_cell = "1.0"
|
once_cell = "1.0"
|
||||||
textwrap = { version = "0.13", features = ["hyphenation"] }
|
textwrap = { version = "0.13.2", features = ["hyphenation"] }
|
||||||
hyphenation = "0.8"
|
hyphenation = "0.8"
|
||||||
|
|
||||||
[dependencies.gst]
|
[dependencies.gst]
|
||||||
|
|
|
@ -95,18 +95,8 @@ impl Default for Settings {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME: Not needed anymore after https://github.com/mgeisler/textwrap/pull/254
|
|
||||||
#[derive(Debug)]
|
|
||||||
struct Splitter(Box<dyn textwrap::WordSplitter + Send>);
|
|
||||||
|
|
||||||
impl textwrap::WordSplitter for Splitter {
|
|
||||||
fn split_points(&self, word: &str) -> Vec<usize> {
|
|
||||||
self.0.split_points(word)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
struct State {
|
struct State {
|
||||||
options: Option<textwrap::Options<'static, Splitter>>,
|
options: Option<textwrap::Options<'static, Box<dyn textwrap::WordSplitter + Send>>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for State {
|
impl Default for State {
|
||||||
|
@ -156,12 +146,12 @@ impl TextWrap {
|
||||||
|
|
||||||
Some(textwrap::Options::with_splitter(
|
Some(textwrap::Options::with_splitter(
|
||||||
settings.columns as usize,
|
settings.columns as usize,
|
||||||
Splitter(Box::new(standard)),
|
Box::new(standard),
|
||||||
))
|
))
|
||||||
} else {
|
} else {
|
||||||
Some(textwrap::Options::with_splitter(
|
Some(textwrap::Options::with_splitter(
|
||||||
settings.columns as usize,
|
settings.columns as usize,
|
||||||
Splitter(Box::new(textwrap::NoHyphenation)),
|
Box::new(textwrap::NoHyphenation),
|
||||||
))
|
))
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue