Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion exercises/diamond/example.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
static ABC: &'static str = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
static ABC: &str = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";

pub fn get_diamond(diamond_char: char) -> Vec<String> {
let mut result: Vec<String> = Vec::new();
Expand Down
2 changes: 1 addition & 1 deletion exercises/nucleotide-count/example.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::collections::HashMap;

static VALID_NUCLEOTIDES: &'static str = "ACGT";
static VALID_NUCLEOTIDES: &str = "ACGT";

fn valid(c: char) -> Result<char, char> {
if VALID_NUCLEOTIDES.contains(c) {
Expand Down
2 changes: 1 addition & 1 deletion exercises/pangram/example.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ fn english_letter_set() -> BTreeSet<char> {
BTreeSet::from_iter(ENGLISH_ALPHABET.chars())
}

const ENGLISH_ALPHABET: &'static str = "abcdefghijklmnopqrstuvwxyz";
const ENGLISH_ALPHABET: &str = "abcdefghijklmnopqrstuvwxyz";
4 changes: 2 additions & 2 deletions exercises/robot-name/example.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ pub struct Robot {

fn generate_name() -> String {
let mut s = String::with_capacity(5);
static LETTERS: &'static [u8] = b"ABCDEFGHIJKLMNOPQRSTUVWXYZ";
static NUMBERS: &'static [u8] = b"0123456789";
static LETTERS: &[u8] = b"ABCDEFGHIJKLMNOPQRSTUVWXYZ";
static NUMBERS: &[u8] = b"0123456789";
for _ in 0..2 {
s.push(*thread_rng().choose(LETTERS).unwrap() as char);
}
Expand Down
2 changes: 1 addition & 1 deletion exercises/roman-numerals/example.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::fmt;

static ROMAN_MAP: [(usize, &'static str); 13] = [
static ROMAN_MAP: [(usize, &str); 13] = [
(1, "I"),
(4, "IV"),
(5, "V"),
Expand Down
6 changes: 3 additions & 3 deletions exercises/say/example.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const SMALL: &'static [&'static str] = &[
const SMALL: &[&str] = &[
"zero",
"one",
"two",
Expand All @@ -21,11 +21,11 @@ const SMALL: &'static [&'static str] = &[
"nineteen",
];

const TENS: &'static [&'static str] = &[
const TENS: &[&str] = &[
"ones", "ten", "twenty", "thirty", "forty", "fifty", "sixty", "seventy", "eighty", "ninety",
];

const SCALE: &'static [&'static str] = &[
const SCALE: &[&str] = &[
"",
"thousand",
"million",
Expand Down