summary refs log tree commit diff
path: root/net_util
diff options
context:
space:
mode:
authorDavid Tolnay <dtolnay@chromium.org>2019-04-15 15:56:35 -0700
committerchrome-bot <chrome-bot@chromium.org>2019-04-18 19:51:01 -0700
commit64cd5eae5778b86f6e498a6fa1b1962693aa5a46 (patch)
tree9b68f7fce3385c410f4fd9c4e978660a9b5a0973 /net_util
parentb1de6323ab8c96c52a60e0ff735e4bbb8a8464c9 (diff)
downloadcrosvm-64cd5eae5778b86f6e498a6fa1b1962693aa5a46.tar
crosvm-64cd5eae5778b86f6e498a6fa1b1962693aa5a46.tar.gz
crosvm-64cd5eae5778b86f6e498a6fa1b1962693aa5a46.tar.bz2
crosvm-64cd5eae5778b86f6e498a6fa1b1962693aa5a46.tar.lz
crosvm-64cd5eae5778b86f6e498a6fa1b1962693aa5a46.tar.xz
crosvm-64cd5eae5778b86f6e498a6fa1b1962693aa5a46.tar.zst
crosvm-64cd5eae5778b86f6e498a6fa1b1962693aa5a46.zip
edition: Eliminate ref keyword
As described in:
https://doc.rust-lang.org/edition-guide/rust-2018/ownership-and-lifetimes/default-match-bindings.html
which also covers the new mental model that the Rust Book will use for
teaching binding modes and has been found to be more friendly for both
beginners and experienced users.

Before:

    match *opt {
        Some(ref v) => ...,
        None => ...,
    }

After:

    match opt {
        Some(v) => ...,
        None => ...,
    }

TEST=cargo check --all-features
TEST=local kokoro

Change-Id: I3c5800a9be36aaf5d3290ae3bd3116f699cb00b7
Reviewed-on: https://chromium-review.googlesource.com/1566669
Commit-Ready: David Tolnay <dtolnay@chromium.org>
Tested-by: David Tolnay <dtolnay@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Diffstat (limited to 'net_util')
-rw-r--r--net_util/src/lib.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/net_util/src/lib.rs b/net_util/src/lib.rs
index 591fa99..4122b05 100644
--- a/net_util/src/lib.rs
+++ b/net_util/src/lib.rs
@@ -671,7 +671,7 @@ mod tests {
         match res {
             // We won't have permission in test environments; allow that
             Ok(_t) => {}
-            Err(Error::IoctlError(ref e)) if e.errno() == EPERM => {}
+            Err(Error::IoctlError(e)) if e.errno() == EPERM => {}
             Err(e) => panic!("Unexpected Error:\n{}", e),
         }
     }