1. 4
  1.  

  2. 1

    If you’ve struggled with Rust’s two string types, it’s:

    • &str == std::string_view
    • String == std::string

    and when you try to return &str, you get the dreaded “borrowed value does not live long enough” error. That’s the exact same error as you get in std::string_view getName() example in the TFA.