The Secret Life of Cows

in Links

https://deterministic.space/secret-life-of-cows.html

TIL that you can use Rust’s Cow for representing a type that can either be borrowed or owned. This can be useful when you want to, for example, return either a static string (&'static str) or a dynamically generated owned string (String) from a function.

If you enjoy my writing, you can subscribe to my email newsletter to get notified every time I publish a new post.

You can also subscribe to my posts using my RSS feed.