LPireyn
#rust
Borrow vs. AsRef
A short explanation of the difference between the Borrow and the AsRef traits in Rust.
The
BorrowandAsReftraits in Rust are very similar. Both have an associated type and a single required method with the same signature. The difference between these traits lies entirely in their contract.
Rust vs. Java: String
A comparison between the String type in Rust and Java.
As a Java developer learning Rust, my first intuition was to think of Rust’s
Stringtype as the equivalent of Java’sStringclass. Though legitimate, this intuition is deceitful: there are important differences between the two types.