LPireyn

#rust

Borrow vs. AsRef

A short explanation of the difference between the Borrow and the AsRef traits in Rust.

Published on . Reading time: 2 minutes.

Tagged with #rust.

The Borrow and AsRef traits 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.

Read the post

Rust vs. Java: String

A comparison between the String type in Rust and Java.

Published on . Reading time: 3 minutes.

Tagged with #java and #rust.

As a Java developer learning Rust, my first intuition was to think of Rust’s String type as the equivalent of Java’s String class. Though legitimate, this intuition is deceitful: there are important differences between the two types.

Read the post