Skip to content

Commit

Permalink
pangram: use collect() instead of from_iter() (#1034)
Browse files Browse the repository at this point in the history
Same idea as #1027 but for examples
not stubs.
  • Loading branch information
petertseng authored Nov 21, 2020
1 parent b5f426f commit 0b3a64e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions exercises/pangram/example.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use std::collections::BTreeSet;
use std::iter::FromIterator;

pub fn is_pangram(sentence: &str) -> bool {
sentence
Expand All @@ -12,7 +11,7 @@ pub fn is_pangram(sentence: &str) -> bool {
}

fn english_letter_set() -> BTreeSet<char> {
BTreeSet::from_iter(ENGLISH_ALPHABET.chars())
ENGLISH_ALPHABET.chars().collect()
}

const ENGLISH_ALPHABET: &str = "abcdefghijklmnopqrstuvwxyz";

0 comments on commit 0b3a64e

Please sign in to comment.