Skip to content

Commit

Permalink
rename package to norm
Browse files Browse the repository at this point in the history
the `norm` crate was finally removed for squatting
  • Loading branch information
noib3 committed Dec 12, 2023
1 parent d8d786e commit 17a824d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 35 deletions.
7 changes: 2 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[package]
name = "norms"
name = "norm"
version = "0.1.1"
edition = "2021"
authors = ["Riccardo Mazzarini <[email protected]>"]
description = "A collection of distance metrics on strings"
documentation = "https://docs.rs/norms"
documentation = "https://docs.rs/norm"
repository = "https://github.com/nomad/norm"
readme = "README.md"
license = "MIT"
Expand All @@ -16,9 +16,6 @@ exclude = ["/.github", "/fuzz", "CHANGELOG.md"]
features = ["fzf-v1", "fzf-v2"]
rustdoc-args = ["--cfg", "docsrs"]

[lib]
name = "norm"

[features]
fzf-v1 = ["__any-metric"]
fzf-v2 = ["__any-metric"]
Expand Down
34 changes: 4 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# 📐 norm

[![Latest version]](https://crates.io/crates/norms)
[![Docs badge]](https://docs.rs/norms)
[![Latest version]](https://crates.io/crates/norm)
[![Docs badge]](https://docs.rs/norm)
[![CI]](https://github.com/nomad/norm/actions)

[Latest version]: https://img.shields.io/crates/v/norms.svg
[Docs badge]: https://docs.rs/norms/badge.svg
[Latest version]: https://img.shields.io/crates/v/norm.svg
[Docs badge]: https://docs.rs/norm/badge.svg
[CI]: https://github.com/nomad/norm/actions/workflows/ci.yml/badge.svg

norm is a collection of different distance metrics on stings. This problem is
Expand Down Expand Up @@ -71,30 +71,4 @@ assert_eq!(ranges.len(), 1);
assert_eq!(ranges[0], 2..4); // The first "aa" in "Ulaanbaatar"
```

## A note on the crate's naming scheme

norm's `package.name` is `norms`, while its `lib.name` is `norm`. This is
because the package name has to be unique to be published to [crates.io], but
unfortunately `norm` is already taken by a crate squatter.
What this means is that you should import norm as `norms` in your `Cargo.toml`,
and `use` it as `norm` in your source code.

For example:

```toml
# Cargo.toml
[dependencies]
norms = { version = "0.1", features = ["fzf-v2"] }
```

```rust
// main.rs
use norm::fzf::FzfV2;

fn main() {
println!("{:?}", FzfV2::new());
}
```

[bench]: https://github.com/noib3/fuzzy-benches
[crates.io]: https://crates.io

0 comments on commit 17a824d

Please sign in to comment.