99a046da46
This is mostly a finger exercise, and an experiment in "what does grcov consider to be coverage". Here's what I've found out... * In grcov's eyes, most #[derive(Foo)] lines count as containing code; but calling any one derived function counts as calling those lines. * Unlike with tarpaulin, it is actually possible to reach 100% grcov line coverage. (Tarpaulin likes to pick "}" lines and tell you that you never reached them; or sometimes it picks expression statements that have the effect of a return, and tells you that they're unreached. Even with these tests, tarpaulin claims that the line coverage of tor-units is only 97.3%.) * In rust, it may be a bit hopeless trying to get high function coverage. Even though we've hit every line of the tor-units crate, the function coverage from its own tests is only 9.38% (55.41% from other crates). I think this is probably due to derived functions, or maybe due to generics getting instantiated? I've got no idea; the denominator for the function coverage lines fluctuates oddly. |
||
---|---|---|
.. | ||
src | ||
Cargo.toml | ||
README.md |
README.md
tor-units
tor-units
-- Safe wrappers for primitive numeric types.
Overview
This crate is part of Arti, a project to implement Tor in Rust. It provides safe wrappers for primitive numeric wrappers used in other parts of Arti. In particular, it provides:
- a bounded i32 with both checked and clamping constructors,
- an integer milliseconds wrapper with conversion to [
Duration
] - an integer seconds wrapper with conversion to [
Duration
] - a percentage wrapper, to prevent accidental failure to divide by 100.
- a SendMeVersion which can be compared only.
License: MIT OR Apache-2.0