Consider the code:
use hyphenation;
use hyphenation::Load;
use textwrap;
let us_hyph = hyphenation::Standard::from_embedded(
hyphenation::Language::EnglishUS).unwrap();
let input = "participation is the key to sucess";
let wrapper = textwrap::Wrapper::new(10);
let output = "participat\nion is the\nkey to\nsucess";
assert_eq!(output, wrapper.fill(input));
let wrapper = textwrap::Wrapper::with_splitter(10, us_hyph);
let output = "participa-\ntion\n \nis the key\nto sucess";
assert_eq!(output, wrapper.fill(input));
// expected output "participa-\ntion is the\nkey to\nsucess";
The first wrapper works okay (though it has to split the word in the middle) but the second wrapper with the hyphenator ends up having a blank third line instead of the expected result (in comments).
This might be a bug in the hyphenator library, but I'm not familiar enough with the code to know.
Consider the code:
The first wrapper works okay (though it has to split the word in the middle) but the second wrapper with the hyphenator ends up having a blank third line instead of the expected result (in comments).
This might be a bug in the hyphenator library, but I'm not familiar enough with the code to know.