Rust equality and ordering

std::cmp The std::cmp module offers several traits for comparing values. It allows us to check for equality and determine the ordering of values. Unlike some other languages where the compiler automatically provides these implementations, Rust requires us to explicitly implement or derive these traits. Implementing these traits can sometimes be challenging. In this post, we will explore the PartialEq, Eq, PartialOrd, Ord, and Reverse traits in detail. PartialEq Many might assume that PartialEq is termed “partial” because it only compares certain parts of a type....

January 11, 2025 · 13 min · Rustin liu

Feedback on `cargo-info` to prepare it for merging

Reminder I am working on merging the cargo-info subcommand into Cargo. There are a few points that need to be addressed before merging. I would like to get feedback on these points. You can find the key points of concern at the end of this post. Background This adds a new subcommand to Cargo, cargo info. This subcommand would allow users to get information about a crate from the command line, without having to go to the web....

February 1, 2024 · 5 min · Rustin liu

Cargo: From Git Index to Sparse Index

September 24, 2023 · 0 min · Rustin liu

How to use trycmd to test your Rust CLI?

Recently we released Rustup 1.26.0, which includes a bunch of new features and bug fixes. We also upgraded the clap version to 3.2.25, which is a major version upgrade. This upgrade was a bit tricky, because clap 3.0.0 had a lot of breaking changes. We needed to make sure that the new version of Rustup worked as expected. So before we upgraded clap we added UI tests for Rustup. We use trycmd to test the CLI of Rustup....

July 3, 2023 · 10 min · Rustin liu