Skip to content

Commit f784313

Browse files
authored
remove unnecessary static lifetimes from exercises (#1013)
1 parent 465ac7e commit f784313

File tree

6 files changed

+9
-9
lines changed

6 files changed

+9
-9
lines changed

exercises/diamond/example.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
static ABC: &'static str = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
1+
static ABC: &str = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
22

33
pub fn get_diamond(diamond_char: char) -> Vec<String> {
44
let mut result: Vec<String> = Vec::new();

exercises/nucleotide-count/example.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use std::collections::HashMap;
22

3-
static VALID_NUCLEOTIDES: &'static str = "ACGT";
3+
static VALID_NUCLEOTIDES: &str = "ACGT";
44

55
fn valid(c: char) -> Result<char, char> {
66
if VALID_NUCLEOTIDES.contains(c) {

exercises/pangram/example.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ fn english_letter_set() -> BTreeSet<char> {
1515
BTreeSet::from_iter(ENGLISH_ALPHABET.chars())
1616
}
1717

18-
const ENGLISH_ALPHABET: &'static str = "abcdefghijklmnopqrstuvwxyz";
18+
const ENGLISH_ALPHABET: &str = "abcdefghijklmnopqrstuvwxyz";

exercises/robot-name/example.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ pub struct Robot {
77

88
fn generate_name() -> String {
99
let mut s = String::with_capacity(5);
10-
static LETTERS: &'static [u8] = b"ABCDEFGHIJKLMNOPQRSTUVWXYZ";
11-
static NUMBERS: &'static [u8] = b"0123456789";
10+
static LETTERS: &[u8] = b"ABCDEFGHIJKLMNOPQRSTUVWXYZ";
11+
static NUMBERS: &[u8] = b"0123456789";
1212
for _ in 0..2 {
1313
s.push(*thread_rng().choose(LETTERS).unwrap() as char);
1414
}

exercises/roman-numerals/example.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use std::fmt;
22

3-
static ROMAN_MAP: [(usize, &'static str); 13] = [
3+
static ROMAN_MAP: [(usize, &str); 13] = [
44
(1, "I"),
55
(4, "IV"),
66
(5, "V"),

exercises/say/example.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const SMALL: &'static [&'static str] = &[
1+
const SMALL: &[&str] = &[
22
"zero",
33
"one",
44
"two",
@@ -21,11 +21,11 @@ const SMALL: &'static [&'static str] = &[
2121
"nineteen",
2222
];
2323

24-
const TENS: &'static [&'static str] = &[
24+
const TENS: &[&str] = &[
2525
"ones", "ten", "twenty", "thirty", "forty", "fifty", "sixty", "seventy", "eighty", "ninety",
2626
];
2727

28-
const SCALE: &'static [&'static str] = &[
28+
const SCALE: &[&str] = &[
2929
"",
3030
"thousand",
3131
"million",

0 commit comments

Comments
 (0)