Refresh Cargo.toml, README.md

Remove superfluous things, update useful things.
This commit is contained in:
Chris Morgan 2022-01-25 12:56:30 +11:00
parent 8ebb2d7e04
commit 7719a1c61b
2 changed files with 5 additions and 16 deletions

View file

@ -1,11 +1,9 @@
[package]
name = "anymap"
version = "0.12.1"
authors = ["Chris Morgan <me@chrismorgan.info>"]
authors = ["Chris Morgan <rust@chrismorgan.info>"]
description = "A safe and convenient store for one value of each type"
documentation = "https://docs.rs/anymap"
#homepage = "https://github.com/chris-morgan/anymap"
repository = "https://github.com/chris-morgan/anymap"
readme = "README.md"
keywords = ["container", "data-structure", "map"]
keywords = ["container", "any", "map"]
categories = ["rust-patterns", "data-structures"]
license = "BlueOak-1.0.0 OR MIT OR Apache-2.0"

View file

@ -1,7 +1,4 @@
``AnyMap``, a safe and convenient store for one value of each type
==================================================================
[![Build Status](https://travis-ci.org/chris-morgan/anymap.svg?branch=master)](https://travis-ci.org/chris-morgan/anymap)
# ``AnyMap``, a safe and convenient store for one value of each type
If youre familiar with Go and Go web frameworks, you may have come across the common “environment” pattern for storing data related to the request. Its typically something like ``map[string]interface{}`` and is accessed with arbitrary strings which may clash and type assertions which are a little unwieldy and must be used very carefully. (Personally I would consider that it is just *asking* for things to blow up in your face.) In a language like Go, lacking in generics, this is the best that can be done; such a thing cannot possibly be made safe without generics.
@ -13,13 +10,7 @@ The ``AnyMap`` type is a friendly wrapper around a ``HashMap<TypeId, Box<Any>>``
What this means is that in an ``AnyMap`` you may store zero or one values for every type.
Instructions
------------
Cargo all the way: it is `anymap` on crates.io.
Unsafe code in this library
---------------------------
## Unsafe code in this library
This library uses a fair bit of unsafe code for several reasons: