News for hackers. Stuff that matters.
Re:Grids in Rust, Part 2: const generics by steveklabnik on Monday April 05, 2021 @03:20PM (#26703361)
Totally. It works the same way: it's gotta be behind a pointer. Arc<str> would be a signature for a threadsafe interned string, for example.

    use std::sync::Arc;
    
    fn foobar(s: &str) -> Arc<str> {
        Arc::from(s.to_string())
    }
You almost always can only create these sorts of values by casting.

There are no comments on this comment yet.