#metadata #parse #author

cargo_author

Parse author fields (name (url)) used by Cargo and npm

4 stable releases

1.0.4 Feb 1, 2021
1.0.2 Apr 18, 2019
1.0.1 Mar 23, 2019
1.0.0 Jun 15, 2018

#299 in Parser implementations

43 downloads per month
Used in cargo-authors

Apache-2.0 OR MIT

6KB
98 lines

Parse authors key in Cargo.toml

This parses names in format Name <email> (url) used in Cargo.toml metadata (also in npm).

This crate tries to parse any field in any order and to fix common errors to salvage as much data as possible.

To read the authors key from Cargo.toml you'll need cargo_toml crate. Once you have the author names, parse them by calling Author::new(string).


lib.rs:

Extract structured information from authors fields used in Cargo.toml

It's tweaked to handle actual odd/broken cases found in Cargo crates.

Strings are normalized to Unicode NFC, since some tools tend to insert decomposed names that expose rendering bugs in software.

Dependencies

~2MB
~71K SLoC