2023-03-22
2084
#rust
Yashodhan Joshi
163607
109
Mar 22, 2023 â‹… 7 min read

Using Cow in Rust for efficient memory utilization

Yashodhan Joshi I am a student interested in physics and systems programming currently exploring Rust and operating systems. I am also passionate about helping others learn.

Recent posts:

Radix Ui Adoption Guide Overview Examples And Alternatives

Radix UI adoption guide: Overview, examples, and alternatives

Radix UI is quickly rising in popularity and has become an excellent go-to solution for building modern design systems and websites.

Nefe Emadamerho-Atori
Apr 25, 2024 â‹… 11 min read
Understanding The Css Revert Layer Keyword, Part Of Css Cascade Layers

Understanding the CSS revert-layer keyword

In this article, we’ll explore CSS cascade layers — and, specifically, the revert-layer keyword — to help you refine your styling strategy.

Chimezie Innocent
Apr 24, 2024 â‹… 6 min read
Exploring Nushell, A Rust Powered, Cross Platform Shell

Exploring Nushell, a Rust-powered, cross-platform shell

Nushell is a modern, performant, extensible shell built with Rust. Explore its pros, cons, and how to install and get started with it.

Oduah Chigozie
Apr 23, 2024 â‹… 6 min read
Exploring Zed, A Newly Open Source Code Editor Written In Rust

Exploring Zed, an open source code editor written in Rust

The Zed code editor sets itself apart with its lightning-fast performance and cutting-edge collaborative features.

Nefe Emadamerho-Atori
Apr 22, 2024 â‹… 7 min read
View all posts

2 Replies to "Using Cow in Rust for efficient memory utilization"

  1. I really enjoyed your post. It really helped understand the problem well.
    I think there is a small bug, it doesn’t distract much from the value of the post, but it’s always nice if the code works. The first example is missing `seen_ids.insert(element.id.clone());`, or something of the sort when looping through the list to track if an id has been seen. The second code snippet has the HashSet insert.

    1. Hey Marc, thanks a lot for noticing and reporting this! The first example was initially supposed to be just a pseudo-code / algorithm, and then the proper code was supposed to be the second snippet. However, While writing and re-writing, I slipped in some code in the first, and the final version had the missing code line that you noticed. In any case I should have taken more care.
      Thanks a lot for commenting this, I have fixed the error now. Hope you found this post useful and fun to read!

Leave a Reply