Something something Sec/DevOps/SRE/SE/meh…

  • 0 Posts
  • 2 Comments
Joined 2 years ago
cake
Cake day: May 11th, 2023

help-circle
  • @hatchet That is true and I mostly agree with you. AsRef makes function signatures more complex and you effectively change a simple function into a generic function.

    That said, when using some crates that make heavy use of this construction (especially when working with owned values in call chains) is sometimes significantly more ergonomic.

    So AsRef definitely had it’s uses, but I agree that it probably shouldn’t be the recommended “best practice” for all crates.