#default #map #default-value #compact #data

dpc-simplemap

Simple map with default value and compacting

4 releases

Uses old Rust 2015

0.1.0 Mar 23, 2016
0.0.3 Dec 4, 2015
0.0.2 Aug 2, 2015
0.0.1 Jun 23, 2015

#1494 in Data structures

MPL-2.0 license

13KB
323 lines

simplemap

Build Status Gitter Chat
Documentation

Introduction

Simple Map with default for missing values and compacting (removal of default values from underlying map).

Usage

Simplemap version 0.0.2 compiles only with Rust nightly. If you want stable-compatibility use no_hash_state branch.

In Carto.toml

[dependencies]
dpc-simplemap = "*"

In src/main.rs:

extern crate simplemap;

lib.rs:

Simple Map with default for missing values and compacting (removal of elements with default value from underlying map).

So you can just:

use simplemap::SimpleMap;

let mut map = SimpleMap::new();

assert_eq!(map[0u32], 0u32);
map[1] = 3;
assert_eq!(map[1], 3);

Dependencies

~18KB