about summary refs log tree commit diff
path: root/src/libgetopts/lib.rs
diff options
context:
space:
mode:
authordileepb <dileepbapat@gmail.com>2016-02-23 21:18:07 +0530
committerdileepb <dileepbapat@gmail.com>2016-02-23 21:21:51 +0530
commitfbfe70e6ab26c0cccb5fbbf5b805eecb751cb576 (patch)
tree3cbbaa4b464bf6288f1fa9555d2a8f6b4dbd3cc8 /src/libgetopts/lib.rs
parent6ffd7cd1664b70fed34861df3957ddee87ec9ad1 (diff)
downloadrust-fbfe70e6ab26c0cccb5fbbf5b805eecb751cb576.tar.gz
rust-fbfe70e6ab26c0cccb5fbbf5b805eecb751cb576.zip
#31820 - Utilize `if..let` instead of single `match` branch
Diffstat (limited to 'src/libgetopts/lib.rs')
-rw-r--r--src/libgetopts/lib.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/libgetopts/lib.rs b/src/libgetopts/lib.rs
index 57ce53e73b0..fe059076926 100644
--- a/src/libgetopts/lib.rs
+++ b/src/libgetopts/lib.rs
@@ -331,9 +331,8 @@ impl Matches {
     /// Returns the string argument supplied to one of several matching options or `None`.
     pub fn opts_str(&self, names: &[String]) -> Option<String> {
         for nm in names {
-            match self.opt_val(&nm[..]) {
-                Some(Val(ref s)) => return Some(s.clone()),
-                _ => (),
+            if let Some(Val(ref s)) = self.opt_val(&nm[..]) {
+                  return Some(s.clone())
             }
         }
         None