Skip to content

Commit

Permalink
#84 less deps
Browse files Browse the repository at this point in the history
  • Loading branch information
yegor256 committed Apr 26, 2023
1 parent b6a7cf0 commit 8a7dffa
Show file tree
Hide file tree
Showing 13 changed files with 47 additions and 382 deletions.
243 changes: 0 additions & 243 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 0 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,7 @@ categories = ["data-structures", "memory-management"]
serde = { version = "1.0.160", optional = true, default-features = false }

[dev-dependencies]
anyhow = "1.0.70"
bincode = "1.3.3"
simple_logger = "4.1.0"
log = "0.4.17"
ctor = "0.2.0"
hashbrown = "0.13.2"
rustc-hash = "1.1.0"
nohash-hasher = "0.2.0"
Expand Down
9 changes: 2 additions & 7 deletions src/clone.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,15 @@ impl<K: Clone + PartialEq, V: Clone, const N: usize> Clone for Map<K, V, N> {
}
}

#[cfg(test)]
use anyhow::Result;

#[test]
fn map_can_be_cloned() -> Result<()> {
fn map_can_be_cloned() {
let mut m: Map<u8, u8, 16> = Map::new();
m.insert(0, 42);
assert_eq!(42, *m.clone().get(&0).unwrap());
Ok(())
}

#[test]
fn empty_map_can_be_cloned() -> Result<()> {
fn empty_map_can_be_cloned() {
let m: Map<u8, u8, 16> = Map::new();
assert!(m.clone().is_empty());
Ok(())
}
12 changes: 3 additions & 9 deletions src/ctors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,27 +52,21 @@ impl<K: Clone + PartialEq, V: Clone, const N: usize> Drop for Map<K, V, N> {
}
}

#[cfg(test)]
use anyhow::Result;

#[test]
fn makes_default_map() -> Result<()> {
fn makes_default_map() {
let m: Map<u8, u8, 8> = Map::default();
assert_eq!(0, m.len());
Ok(())
}

#[test]
fn makes_new_map() -> Result<()> {
fn makes_new_map() {
let m: Map<u8, u8, 8> = Map::new();
assert_eq!(0, m.len());
Ok(())
}

#[test]
fn drops_correctly() -> Result<()> {
fn drops_correctly() {
let _m: Map<Vec<u8>, u8, 8> = Map::new();
Ok(())
}

#[test]
Expand Down
Loading

0 comments on commit 8a7dffa

Please sign in to comment.