breaking-attr

Crates.iobreaking-attr
lib.rsbreaking-attr
version0.2.0
created_at2025-03-24 21:26:55.39732+00
updated_at2025-04-08 22:37:20.741166+00
descriptionAn attribute macro that enforces per-version invariants on items.
homepagehttps://github.com/Waridley/breaking-attr
repositoryhttps://github.com/Waridley/breaking-attr
max_upload_size
id1604433
size34,181
(Waridley)

documentation

README

Crates.io Version docs.rs GitHub Actions Workflow Status

An attribute macro to enforce per-version invariants on items.

use breaking_attr::breaking;

#[test]
fn hash_impl_did_not_change() {
    #[breaking(sha2 = "zEk8F98i1LX-Rr070lCztGerzO1-qlLbosetY1UvSww=")]
    const SEED: &str = "This value must not change between minor versions.";

    #[breaking("3zIKlGMq-shMmThdYSOntWhl9QCx3A23i8tnEfNPWBY=")] // defaults to `blake3`
    const HASH: u64 = 5201689092505688044;
    
    // Just for example:
    let mut hasher = std::hash::DefaultHasher::new();
    hasher.write(SEED.as_bytes());
    debug_assert_eq!(hasher.finish(), HASH);
}
Commit count: 14

cargo fmt