count-unsafe

Crates.iocount-unsafe
lib.rscount-unsafe
version0.1.1
sourcesrc
created_at2023-03-16 21:30:02.469507
updated_at2023-09-11 09:05:12.555151
descriptionRecursively count unsafe Rust code in a given path.
homepage
repositoryhttps://github.com/mkroening/count-unsafe
max_upload_size
id812095
size30,181
Martin Kröning (mkroening)

documentation

README

count-unsafe

Crates.io CI

Count-unsafe counts the amount of unsafe Rust code in a given path.

This project is built on the geiger library. In contrast to cargo-geiger though, this application does not integrate with cargo and simply counts unsafe code in all Rust source files in a given path.

Installation

This project is available on crates.io:

cargo install count-unsafe

Example

Running count-unsafe on Cargo's source (0.69.0):

$ count-unsafe cargo/src
{
  "functions": {
    "safe": 759,
    "unsafe_": 2
  },
  "exprs": {
    "safe": 50434,
    "unsafe_": 238
  },
  "item_impls": {
    "safe": 549,
    "unsafe_": 0
  },
  "item_traits": {
    "safe": 16,
    "unsafe_": 0
  },
  "methods": {
    "safe": 1804,
    "unsafe_": 0
  }
}

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Commit count: 11

cargo fmt