When returning an immutable reference to a private struct field. (On mobile and used vertical bars instead of a bunch of HTML codes)

  • jpfreely@programming.devOP
    link
    fedilink
    arrow-up
    1
    ·
    1 year ago

    Right, I want the convenience of &[&str] , but if it requires creating a second collection then I think &[String] is better. Use cases that require &str can just map to as_str.