Skip to content

Commit

Permalink
vecs
Browse files Browse the repository at this point in the history
  • Loading branch information
robertbastian committed Aug 30, 2023
1 parent 19625cf commit 4e07bef
Show file tree
Hide file tree
Showing 33 changed files with 188 additions and 205 deletions.
2 changes: 1 addition & 1 deletion components/calendar/src/persian.rs
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,7 @@ mod tests {
expected_next: i32,
}

let test_cases = vec![
let test_cases = [
TestCase {
input: 0,
expected_prev: -1,
Expand Down
2 changes: 1 addition & 1 deletion components/collator/benches/bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ pub fn collator_with_locale(criterion: &mut Criterion) {
// In particular, to get full Japanese standard behavior, you need the identical strength.
// Furthermore, CLDR used to default to quaternary for Japanese but now defaults to tertiary
// as for every other language for performance reasons.
let all_strength = vec![
let all_strength = [
Strength::Primary,
Strength::Secondary,
Strength::Tertiary,
Expand Down
4 changes: 2 additions & 2 deletions components/collections/src/char16trie/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
//!
//! // A Char16Trie containing the ASCII characters mapping 'a' to 1 and 'ab'
//! // to 100.
//! let trie_data = vec![48, 97, 176, 98, 32868];
//! let trie_data = [48, 97, 176, 98, 32868];
//! let trie =
//! Char16Trie::new(ZeroVec::from_slice_or_alloc(trie_data.as_slice()));
//! Char16Trie::new(ZeroVec::from_slice_or_alloc(&trie_data));
//!
//! let mut iter = trie.iter();
//! let res = iter.next('a');
Expand Down
12 changes: 6 additions & 6 deletions components/collections/src/char16trie/trie.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,9 @@ impl<'a> Char16TrieIterator<'a> {
/// use zerovec::ZeroVec;
///
/// // A Char16Trie containing the ASCII characters 'a' and 'b'.
/// let trie_data = vec![48, 97, 176, 98, 32868];
/// let trie_data = [48, 97, 176, 98, 32868];
/// let trie =
/// Char16Trie::new(ZeroVec::from_slice_or_alloc(trie_data.as_slice()));
/// Char16Trie::new(ZeroVec::from_slice_or_alloc(&trie_data));
///
/// let mut iter = trie.iter();
/// let res = iter.next('a');
Expand Down Expand Up @@ -214,9 +214,9 @@ impl<'a> Char16TrieIterator<'a> {
/// use zerovec::ZeroVec;
///
/// // A Char16Trie containing the ASCII characters 'a' and 'b'.
/// let trie_data = vec![48, 97, 176, 98, 32868];
/// let trie_data = [48, 97, 176, 98, 32868];
/// let trie =
/// Char16Trie::new(ZeroVec::from_slice_or_alloc(trie_data.as_slice()));
/// Char16Trie::new(ZeroVec::from_slice_or_alloc(&trie_data));
///
/// let mut iter = trie.iter();
/// let res = iter.next('a');
Expand Down Expand Up @@ -248,9 +248,9 @@ impl<'a> Char16TrieIterator<'a> {
/// use zerovec::ZeroVec;
///
/// // A Char16Trie containing the ASCII characters 'a' and 'b'.
/// let trie_data = vec![48, 97, 176, 98, 32868];
/// let trie_data = [48, 97, 176, 98, 32868];
/// let trie =
/// Char16Trie::new(ZeroVec::from_slice_or_alloc(trie_data.as_slice()));
/// Char16Trie::new(ZeroVec::from_slice_or_alloc(&trie_data));
///
/// let mut iter = trie.iter();
/// let res = iter.next16('a' as u16);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use icu_collections::codepointinvlist::CodePointInversionList;
use std::char;

fn uniset_bench(c: &mut Criterion) {
let best_ex = vec![0x41, 0x46];
let best_ex = [0x41, 0x46];
let best_sample = CodePointInversionList::try_from_inversion_list_slice(&best_ex).unwrap();
let worst_ex: Vec<u32> = (0x0..((char::MAX as u32) + 1)).collect();
let worst_sample = CodePointInversionList::try_from_inversion_list_slice(&worst_ex).unwrap();
Expand Down
Loading

0 comments on commit 4e07bef

Please sign in to comment.