Skip to content

Commit

Permalink
Remove TinyStr dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
sffc committed Oct 14, 2023
1 parent 97bb83b commit e6856fd
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions components/timezone/src/metazone.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,27 +133,26 @@ impl MetazoneCalculator {
#[cfg(test)]
mod tests {
use alloc::collections::BTreeMap;
use tinystr::{tinystr, TinyAsciiStr};
use zerovec::ZeroMap2d;

#[test]
fn zeromap2d_metazone() {
let source_data = [
(tinystr!(8, "aedxb"), 0, Some(tinystr!(4, "gulf"))),
(tinystr!(8, "afkbl"), 0, Some(tinystr!(4, "afgh"))),
(tinystr!(8, "ushnl"), 0, None),
(tinystr!(8, "ushnl"), 7272660, Some(tinystr!(4, "haal"))),
(tinystr!(8, "ushnl"), 0, None),
(tinystr!(8, "ushnl"), 7272660, Some(tinystr!(4, "haal"))),
(*b"aedxb", 0, Some(*b"gulf")),
(*b"afkbl", 0, Some(*b"afgh")),
(*b"ushnl", 0, None),
(*b"ushnl", 7272660, Some(*b"haal")),
(*b"ushnl", 0, None),
(*b"ushnl", 7272660, Some(*b"haal")),
];

let btreemap: BTreeMap<(TinyAsciiStr<8>, i32), Option<TinyAsciiStr<4>>> = source_data
let btreemap: BTreeMap<([u8; 5], i32), Option<[u8; 4]>> = source_data
.iter()
.copied()
.map(|(a, b, c)| ((a, b), c))
.collect();

let zeromap2d: ZeroMap2d<TinyAsciiStr<8>, i32, Option<TinyAsciiStr<4>>> =
let zeromap2d: ZeroMap2d<[u8; 5], i32, Option<[u8; 4]>> =
source_data.iter().copied().collect();

let mut btreemap_iter = btreemap.iter();
Expand Down

0 comments on commit e6856fd

Please sign in to comment.