# AsRef versus Into We prefer to use function definitions with flexible strings: * `AsRef` for a function parameter that uses borrowing, such as a readable `&str`. * `Into` for a function parameter that takes ownership, such as writable `String`. ## Example of AsRef Before refactoring: ```rust fn foo(s: &str) ``` After refactoring: ```rust fn foo(s: impl AsRef) ``` ## Example of Into Before refactoring: ```rust fn foo(s: String) ``` After refactoring: ```rust fn foo(s: impl Into) ```