Fix failing to fetch netdev info

This commit is contained in:
Stephen Seo 2022-08-16 15:33:40 +09:00
parent 80acc2526b
commit 73f0b730fa

View file

@ -84,8 +84,9 @@ impl NetInfo {
let mut dev_line: Option<&str> = None;
for line in netdev_string.lines() {
if line.starts_with(&self.dev_name) {
dev_line = Some(line);
let trimmed_line = line.trim();
if trimmed_line.starts_with(&self.dev_name) {
dev_line = Some(trimmed_line);
break;
}
}