• Stars
    star
    378
  • Rank 113,272 (Top 3 %)
  • Language
    Rust
  • License
    Apache License 2.0
  • Created over 9 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Rust container / collection literal macros for HashMap, HashSet, BTreeMap, BTreeSet.

maplit

Container / collection literal macros for HashMap, HashSet, BTreeMap, BTreeSet.

You can use these for convenience. Using them has no other implications.

Please read the API documentation here

build_status crates

Recent Changes

  • 1.0.2
    • Fix usage of the macros through full paths, like maplit::hashmap!(..) (#27)
  • 1.0.1
    • Fix unused_results lint in the macros by @povilasb
  • 1.0.0
    • maplit 1.0!
    • Only documentation changes since the last version
  • 0.1.6
    • Add macro convert_args! for composable opt-in conversion of the expressions being used for the maplit macros.
  • 0.1.5
    • Add license files correctly
    • Add crates.io category
    • Small doc improvements by @seeekr and @sanmai-NL
  • 0.1.4
    • Update docs to point to docs.rs
  • 0.1.2
    • Now supports more arguments in hashset!{} and hashmap!{}
  • 0.1.0
    • Initial release

FAQ

Question: Very large maps take a long time to compile?

Answer: Rustc is very slow to compile big expressions with many literals (including integers and float literals). Work around this by either using explicitly typed literals, or explicitly typed conversions. See #14 for more information.

License

Dual-licensed to be compatible with the Rust project.

Licensed under the Apache License, Version 2.0 http://www.apache.org/licenses/LICENSE-2.0 or the MIT license http://opensource.org/licenses/MIT, at your option. This file may not be copied, modified, or distributed except according to those terms.

More Repositories

1

indexmap

A hash table with consistent order and fast iteration; access items by key or sequence index
Rust
1,361
star
2

arrayvec

A vector with a fixed capacity. (Rust)
Rust
714
star
3

scopeguard

Rust crate for a convenient RAII scope guard.
Rust
429
star
4

either

The enum Either with variants Left and Right is a general purpose sum type with two cases.
Rust
377
star
5

matrixmultiply

General matrix multiplication of f32 and f64 matrices in Rust. Supports matrices with general strides.
Rust
206
star
6

indexing

Sound unchecked indexing using “generativity”; a type system approach to indices, pointers and ranges that are trusted to be in bounds.
Rust
100
star
7

bencher

bencher is just a port of the libtest (unstable) benchmark runner to Rust stable releases. `cargo bench` on stable. "Not a better bencher!" = No feature development. Go build a better stable benchmarking library.
Rust
83
star
8

twoway

Twoway / Fast substring search for strings and byte strings (Rust) / Also assorted benchmarks and string search snippets
Rust
65
star
9

permutohedron

Rust
36
star
10

rustfaq

Bluss' Rust FAQ, intended to answer questions that are often encountered, and being simple to update. There's quite a lot of editing needed to get to a useful FAQ, so we'll see if we get there.
30
star
11

odds

Odds and ends — collection miscellania. Extra functionality for slices, strings and other things
Rust
21
star
12

fast-floats

Experimental (unstable) “fast-math” wrappers for f32, f64
Rust
19
star
13

pyproject-local-kernel

Python Jupyter kernel using pyproject environment manangers like Rye, Uv, PDM, Poetry, Hatch etc.
Python
15
star
14

defmac

A macro to define lambda-like macros inline.
Rust
15
star
15

ixlist

The “ixlist” is a linked list in a vector
Rust
11
star
16

itertools-num

[looking for adoption of the crate] Numerics iterator tools; cumulative sum and linearly spaced floats and such.
Rust
10
star
17

debugit

DebugIt: Use specialization so you can debug-print a value without explicit (and viral) Debug trait bound. (Not really maintained. Uses specialization so it may break)
Rust
10
star
18

thread-tree

A tree-shaped thread pool used for spawning stack-bound scoped jobs with no work stealing. Derived from a little bit of rayon-core code + new thread pool on top.
Rust
10
star
19

tox-rye

Use Rye to discover or fetch Python versions for Tox (v4)
Python
7
star
20

unchecked-index

Unchecked indexing and debug-assertion checked indexing through the regular index syntax.
Rust
7
star
21

qc.rs

quickcheck for Rust
Rust
6
star
22

simplesvg

Very simple drawing/diagramming library with svg output (Rust).
Rust
6
star
23

virtualenv-rye-discovery

Virtualenv plugin for discovery of Python interpreters through Rye.
Python
5
star
24

ryeish-kernel

Python Jupyter kernel using Rye for reproducible notebooks
Python
5
star
25

knuth-morris-pratt

Generic substring search for sequences. Requires elements that are equality comparable.
Rust
5
star
26

galil-seiferas

Galil-Seiferas algorithm: String search in constant space, linear time, for nonorderable alphabets
Rust
5
star
27

rawpointer

Extra methods for raw pointers
Rust
4
star
28

dlx

Dancing Links (“dlx”) solver for the exact cover problem, written in Rust. Can be used to create a sudoku solver.
Rust
4
star
29

rpasha

Restrictive Precise Angle Shadowcasting, a field of view algorithm for a discrete playing field.
Rust
4
star
30

rawslice

Rust
2
star
31

siphash-ppc-altivec

C
2
star
32

asprim

Rust library with a trait for the `as` operator for primitive numeric types.
Rust
2
star
33

blake2-ppc-altivec

BLAKE2s hash function https://blake2.net PowerPC/Altivec implementation by Ulrik Sverdrup
C
2
star
34

trait-group

Rust
2
star
35

blis-sys

[Feel free to adopt/fork this repo!] Experimental Rust bindings for BLIS
Rust
2
star
36

bmap

Experimental B-tree map in Rust using ArrayVec
Rust
1
star
37

rand_derive

(Obsolete) derive(Rand) for use with custom_derive!{}. Works with stable Rust 1.8+
Rust
1
star
38

numeric-loops

Rust
1
star
39

complexfloat

Extended traits for Rust Float and Complex types. Requires Rust 1.8.
Rust
1
star
40

bluss.github.io

HTML
1
star