replace deprecated trim_right_matches with trim_end_matches

trim_end_matches introduced in Rust 1.30.0, deprecation warnings
emitted since 1.33.0.

https://doc.rust-lang.org/std/primitive.str.html#method.trim_end_matches
This commit is contained in:
Chris Mayo 2019-08-23 19:18:24 +01:00
parent d3d48f3e7c
commit 9a456fe570

View File

@ -21,7 +21,7 @@ fn get_systemd_unit_property(unit: &str, prop: &str) -> Result<String> {
.output()
.map(|out| {
String::from_utf8_lossy(&out.stdout[prop.len() + 1..])
.trim_right_matches('\n')
.trim_end_matches('\n')
.to_owned()
})
}
@ -60,7 +60,7 @@ fn main() {
.arg("-n")
.output())
.stdout[..])
.trim_right_matches('\n')
.trim_end_matches('\n')
.to_owned();
if hostname.len() == 0 {