profile
viewpoint

havarnov/rask 4

A simple web framework for Rust

havarnov/asyncresult 2

computational expression for Async<Result<_, _>>

havarnov/googlemusicmediakeyfix 1

Google Music Media Key Fix

havarnov/hyper-async-router 1

a simple router for hyper async

havarnov/oljekk_count 1

Program witch count and display amount of beer "jekked"

havarnov/par_cmd 1

Will perform a given command when it notice action on parallel port

push eventhavarnov/multimap

Håvar Nøvik

commit sha a199996c031c8de1c3a6c38ac854244585f6befc

Bumped version to 0.8.2.

view details

push time in 2 months

push eventhavarnov/multimap

Håvar Nøvik

commit sha 22d3dfc9c9693b684e92a91e5736bbc930dc7dd5

Added changelog entry for 0.8.2

view details

push time in 2 months

push eventhavarnov/multimap

mocsy

commit sha 5699a9bd50370139a737ccf974312a0767bd48ca

Add #![forbid(unsafe_code)] (#27) Since this crate uses no unsafe, it would make sense to signal that to geiger loving folk by adding `#![forbid(unsafe_code)]` for fee.

view details

push time in 2 months

PR merged havarnov/multimap

Add #![forbid(unsafe_code)]

Since this crate uses no unsafe, it would make sense to signal that to geiger loving folk by adding #![forbid(unsafe_code)] for fee.

+1 -0

0 comment

1 changed file

mocsy

pr closed time in 2 months

issue commenthavarnov/multimap

into_iter(_all) would to avoid clone

@schrieveslaach I have to disagree on that not being a breaking change. Anyways, I'll add this to the 1.0.0 milestone.

schrieveslaach

comment created time in 2 months

IssuesEvent

issue closedhavarnov/multimap

insert() doesn't let you know if already existed or not

The docs for mutlimap state:

A MultiMap implementation which is just a wrapper around std::collections::HashMap. See HashMap's documentation for more details.

but the HashMap docs here state

pub fn insert(&mut self, k: K, v: V) -> Option<V>
[src][−]
Inserts a key-value pair into the map.

If the map did not have this key present, None is returned.

If the map did have this key present, the value is updated, and the old value is returned. The key is not updated, though; this matters for types that can be == without being identical. See the module-level documentation for more.

In particular I want to insert an entry into the multi-map and to know if an identical entry already existed in it (to avoid duplicates). The HashMap insert() method helped doing this, the MultiMap one does not.

I can obviously work around this, but thought it would be good if this mirrored the HashMap implementation more closely, from the consumer point of view. Although I see the disadvantage that here it will take more cycles to detect if a matching entry already existed.

closed time in 2 months

andrewdavidmackenzie

issue commenthavarnov/multimap

remove, remove_all or remove_first, remove

I like the idea of a remove_first. And also remove_entry. PR is appreciated!

mocsy

comment created time in 2 months

issue commenthavarnov/multimap

Method to get the total number of elements in a MultiMap

I think it make more sense with MultiMap::len() returns number of keys, but I might be the odd one out.

Anyways, what if we provide a new method for getting the total number of values which can be introduced without breaking backwards compatability? And then maybe switch them around in a possible mayor version update?

PS. Sry for late reply, thanks for being patient 👍

sitaktif

comment created time in 2 months

more