unsafe-to-verified

Crates.iounsafe-to-verified
lib.rsunsafe-to-verified
version1.0.2
created_at2025-04-13 05:22:42.34011+00
updated_at2025-04-13 05:39:12.200266+00
descriptionRenames unsafe to verified (kinda)
homepage
repositoryhttps://github.com/lurkny/verified
max_upload_size
id1631535
size12,099
Brody (lurkny)

documentation

README

Unsafe to Verified

This simple proc macro was inspired by a tweet by HSVSphere, suggesting that the better name for unsafe was verified, which I totally agree with.

Motivation

Unsafe carries a stigma, implying "dangerous" or "broken" when, in reality, it’s just Rust code that requires manual verification of certain invariants (e.g., memory safety, type correctness). By using verified, you’re highlighting the trust in the programmer’s diligence, which can make the code more approachable, especially in teams or projects where unsafe might scare off contributors.

Usage

To add unsafe to a function definition

#[verified_item]
pub fn some_unsafe_code()

Unsafe blocks within a function

pub fn unsafe_code_inside() {
    verified!{
        //do unsafe thing
    }
}

Also works for impl blocks

Commit count: 5

cargo fmt