From d8871f2f18f367a5d26f63eca632e1546d6f53ef Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Wed, 24 Apr 2019 09:35:15 +0200 Subject: [PATCH] src/tools/procfs.rs: avoid useless allocations --- src/tools/procfs.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/procfs.rs b/src/tools/procfs.rs index e81bf82d..3d059173 100644 --- a/src/tools/procfs.rs +++ b/src/tools/procfs.rs @@ -386,7 +386,7 @@ pub fn read_proc_net_ipv6_route() -> Result, Error> { let mut iter = content.split_whitespace(); let mut next = || iter.next() - .ok_or(format_err!("Error while parsing '{}'", path)); + .ok_or_else(|| format_err!("Error while parsing '{}'", path)); let (dest, prefix) = (next()?, next()?); for _ in 0..2 { next()?; }