| Crates.io | breaking-attr |
| lib.rs | breaking-attr |
| version | 0.2.0 |
| created_at | 2025-03-24 21:26:55.39732+00 |
| updated_at | 2025-04-08 22:37:20.741166+00 |
| description | An attribute macro that enforces per-version invariants on items. |
| homepage | https://github.com/Waridley/breaking-attr |
| repository | https://github.com/Waridley/breaking-attr |
| max_upload_size | |
| id | 1604433 |
| size | 34,181 |
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);
}