Skip to content

Unsoundness in src/vec.rs/to_str and maybe unmaintained #7

@lwz23

Description

@lwz23

I think there is a unsound problem in src/vec.rs/to_str https://github.com/NVSL/Corundum/blob/1685af69d9b34d6d2c918c69c3327023ac753f03/src/vec.rs#L1282,

impl<A: MemPool> Vec<u8, A> {
    pub fn to_str(&self) -> &str {
        unsafe { std::str::from_utf8_unchecked(self.as_slice()) }
    }
}

it direct called the "from_utf8_unchecked" without any precondition and the method is declear as 'pub' and not marked as 'unsafe'. But I can't build this project in my current platform. Is this crate unmaintained?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions