about summary refs log tree commit diff
path: root/compiler/rustc_driver/src/args.rs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/rustc_driver/src/args.rs')
-rw-r--r--compiler/rustc_driver/src/args.rs3
1 files changed, 1 insertions, 2 deletions
diff --git a/compiler/rustc_driver/src/args.rs b/compiler/rustc_driver/src/args.rs
index 5686819c61b..4f2febf04b1 100644
--- a/compiler/rustc_driver/src/args.rs
+++ b/compiler/rustc_driver/src/args.rs
@@ -4,8 +4,7 @@ use std::fs;
 use std::io;
 
 pub fn arg_expand(arg: String) -> Result<Vec<String>, Error> {
-    if arg.starts_with('@') {
-        let path = &arg[1..];
+    if let Some(path) = arg.strip_prefix('@') {
         let file = match fs::read_to_string(path) {
             Ok(file) => file,
             Err(ref err) if err.kind() == io::ErrorKind::InvalidData => {