textwrap: Remove workaround that is not needed anymore with textwrap 0.13.2

This commit is contained in:
Sebastian Dröge 2020-12-30 18:49:13 +02:00
parent 078bf81b85
commit 514f6ea7ec
2 changed files with 4 additions and 14 deletions

View file

@ -10,7 +10,7 @@ repository = "https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs"
[dependencies]
glib = { git = "https://github.com/gtk-rs/gtk-rs" }
once_cell = "1.0"
textwrap = { version = "0.13", features = ["hyphenation"] }
textwrap = { version = "0.13.2", features = ["hyphenation"] }
hyphenation = "0.8"
[dependencies.gst]

View file

@ -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 {
options: Option<textwrap::Options<'static, Splitter>>,
options: Option<textwrap::Options<'static, Box<dyn textwrap::WordSplitter + Send>>>,
}
impl Default for State {
@ -156,12 +146,12 @@ impl TextWrap {
Some(textwrap::Options::with_splitter(
settings.columns as usize,
Splitter(Box::new(standard)),
Box::new(standard),
))
} else {
Some(textwrap::Options::with_splitter(
settings.columns as usize,
Splitter(Box::new(textwrap::NoHyphenation)),
Box::new(textwrap::NoHyphenation),
))
};
}