Rust

Rust

Made by DeepSource

Found occurrence of Rc<&str> RS-W1063

Anti-pattern
Minor

Rc<&str> is a pointer to a pointer. This adds another level of indirection without any benefit whatsoever. If the intention is to place a str on the heap, consider using Rc<str>.

Bad practice

fn get_rc_str() -> Rc<&'static str> {
    Rc::from("string")
}

Recommended

fn get_rc_str() -> Rc<str> {
    Rc::from("string")
}