From: Niv Kaminer Date: Wed, 4 Oct 2017 16:17:25 +0000 (+0000) Subject: avoid using match keyword as module name X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=559adb7e0680bd539331a2accfccb3e56813dca1;p=rust.git avoid using match keyword as module name --- diff --git a/src/librustc/benches/lib.rs b/src/librustc/benches/lib.rs index 98e1d92127b..24294ec49ce 100644 --- a/src/librustc/benches/lib.rs +++ b/src/librustc/benches/lib.rs @@ -16,4 +16,4 @@ extern crate test; mod dispatch; -mod match; +mod pattern; diff --git a/src/librustc/benches/match.rs b/src/librustc/benches/match.rs deleted file mode 100644 index 638b1ce3f75..00000000000 --- a/src/librustc/benches/match.rs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -use test::Bencher; - -// Overhead of various match forms - -#[bench] -fn option_some(b: &mut Bencher) { - let x = Some(10); - b.iter(|| { - match x { - Some(y) => y, - None => 11 - } - }); -} - -#[bench] -fn vec_pattern(b: &mut Bencher) { - let x = [1,2,3,4,5,6]; - b.iter(|| { - match x { - [1,2,3,..] => 10, - _ => 11, - } - }); -} diff --git a/src/librustc/benches/pattern.rs b/src/librustc/benches/pattern.rs new file mode 100644 index 00000000000..638b1ce3f75 --- /dev/null +++ b/src/librustc/benches/pattern.rs @@ -0,0 +1,35 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +use test::Bencher; + +// Overhead of various match forms + +#[bench] +fn option_some(b: &mut Bencher) { + let x = Some(10); + b.iter(|| { + match x { + Some(y) => y, + None => 11 + } + }); +} + +#[bench] +fn vec_pattern(b: &mut Bencher) { + let x = [1,2,3,4,5,6]; + b.iter(|| { + match x { + [1,2,3,..] => 10, + _ => 11, + } + }); +}