about summary refs log tree commit diff
path: root/src/liballoc/tests/str.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2019-02-03 18:40:23 +0000
committerbors <bors@rust-lang.org>2019-02-03 18:40:23 +0000
commit4f4f4a40b6c7bcb6fa07ee6575e8a9759ba08922 (patch)
tree28a3d197b75da9125cc8f6de8d912f75c56e7e48 /src/liballoc/tests/str.rs
parente858c2637fa5bac40ac450628b30c56c2b4327b4 (diff)
parent2396780cdaedf097dd6a8f3927749bcaf5b1238b (diff)
Auto merge of #58081 - Centril:liballoc-2018, r=oli-obk
Transition liballoc to Rust 2018

This transitions liballoc to Rust 2018 edition and applies relevant idiom lints.
I also did a small bit of drive-by cleanup along the way.

r? @oli-obk

I started with liballoc since it seemed easiest. In particular, adding `edition = "2018"` to libcore gave me way too many errors due to stdsimd. Ideally we should be able to continue this crate-by-crate until all crates use 2018.
Diffstat (limited to 'src/liballoc/tests/str.rs')
-rw-r--r--src/liballoc/tests/str.rs11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/liballoc/tests/str.rs b/src/liballoc/tests/str.rs
index 66a1b947a7d..1bc1bd8d78c 100644
--- a/src/liballoc/tests/str.rs
+++ b/src/liballoc/tests/str.rs
@@ -584,7 +584,7 @@ mod slice_index {
     }
 
     mod boundary {
-        const DATA: &'static str = "abcαβγ";
+        const DATA: &str = "abcαβγ";
 
         const BAD_START: usize = 4;
         const GOOD_START: usize = 3;
@@ -648,7 +648,7 @@ mod slice_index {
         }
     }
 
-    const LOREM_PARAGRAPH: &'static str = "\
+    const LOREM_PARAGRAPH: &str = "\
     Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse quis lorem \
     sit amet dolor ultricies condimentum. Praesent iaculis purus elit, ac malesuada \
     quam malesuada in. Duis sed orci eros. Suspendisse sit amet magna mollis, mollis \
@@ -1068,7 +1068,7 @@ fn test_rev_iterator() {
 #[test]
 fn test_chars_decoding() {
     let mut bytes = [0; 4];
-    for c in (0..0x110000).filter_map(::std::char::from_u32) {
+    for c in (0..0x110000).filter_map(std::char::from_u32) {
         let s = c.encode_utf8(&mut bytes);
         if Some(c) != s.chars().next() {
             panic!("character {:x}={} does not decode correctly", c as u32, c);
@@ -1079,7 +1079,7 @@ fn test_chars_decoding() {
 #[test]
 fn test_chars_rev_decoding() {
     let mut bytes = [0; 4];
-    for c in (0..0x110000).filter_map(::std::char::from_u32) {
+    for c in (0..0x110000).filter_map(std::char::from_u32) {
         let s = c.encode_utf8(&mut bytes);
         if Some(c) != s.chars().rev().next() {
             panic!("character {:x}={} does not decode correctly", c as u32, c);
@@ -1599,8 +1599,7 @@ fn test_repeat() {
 }
 
 mod pattern {
-    use std::str::pattern::Pattern;
-    use std::str::pattern::{Searcher, ReverseSearcher};
+    use std::str::pattern::{Pattern, Searcher, ReverseSearcher};
     use std::str::pattern::SearchStep::{self, Match, Reject, Done};
 
     macro_rules! make_test {