doc.rust-lang.org
pub fn remove_entry<Q>(&mut self, key: &Q) -> Option<(K, V)>
...The key may be any borrowed form of the map's key type, but the ordering on the borrowed form must match the ordering on the key type.
Examples
use std::collections::BTreeMap;
let mut map = BTreeMap::new();
map.insert(1, "a");
assert_eq!(map.remove_entry(&1), Some((1...
method
alloc
Stable since 1.45.0
Version 1.100.0-nightly
crates.io
...This means that you cannot directly match on an IValue to determine its type. Instead, an IValue offers several ways to get at the inner type: Destructuring using IValue::destructure[{_ref,_mut}]() These methods return wrapper enums which you can directly match on, so these methods are the most direct...
Crate
v0.1.7
2026-07-16
poignardazur.github.io
...foobar(my_a, my_b);
The type system takes the types of my_a and my_b, and finds the least restrictive qualifier that matches both these types. inout becomes that qualifer.
For instance, if my_a is const int* and my_b is int*, inout “becomes” const, and the...
Observations/Thoughts
2022-01-12
~4 min read
rustc-dev-guide.rust-lang.org
...Prefer exhaustive matches
Using _ in a match is convenient, but it means that when new variants are added to the enum, they may not get handled correctly. Ask yourself: if a new variant were added to this enum, what's the chance that it would want to use the _ code...
Guide to Rustc Development
Book
2024-01-01
~4 min read
docs.rs
...std::fs::{symlink_file, symlink_dir} , matching symlink_auto or nothing. std::fs::{soft_link_file, soft_link_dir} , matching soft_link if it is undeprecated. But I don’t like the name “soft link,” anyway: no one calls them that, we all call them symlinks. Note that despite the...
Crate
v0.1.0
2017-01-27
rust-analyzer.github.io
...true
#3580 macro expander is now more tolerant for syntax errors, which makes code completion inside macros more robust.
#3623 Fill Match Arms assist now works even if some arms are already present.
#3607 and instructions for installing rust-analyzer from AUR.
#3640, #3651 assist to merge imports with a...
News & Blog Posts
2020-03-24
~1 min read
www.rsarai.xyz
...use std::path::Path;
use std::fs::File;
use std::io::prelude::*;
fn load_documents(path_str: &str) {
// Create a path to the desired file
let path = Path::new(&path_str);
let display = path.display();
// Open the path in read-only mode, returns `io::Result<File>`
let mut file = match...
Rust Walkthroughs
2022-05-18
~7 min read
rust-analyzer.github.io
#9936 (first contribution) make compiler commit and date optional in proc macros.
#9962 (first contribution) improve "Replace match with if let" code generation.
#9963 resolve core::arch module.
#9973, #9988 refactor and improve handling of overloaded binary operators.
#9943 don’t strip items with built-in attributes.
#9976 hide functional...
Project/Tooling Updates
2021-08-25
~1 min read
arXiv
arxiv.org
...We present GRAFT, which extracts structured API information from Rust documentation, builds an API dependency graph via recursive generics-aware type matching, and uses topology-guided traversal plus LLM synthesis with compiler-error feedback to produce compilable fuzz targets. On 13 crates from crates.io, GRAFT achieves 80.75% macro...
Software Engineering
Yiming Chen, Kaiwen Zhang, Guanjun Liu et al.
2026-08-09
arXiv:2608.08637
magiclen.org
...In this crate, crc32 matches crc32b from mhash , and crc32mhash matches crc32 from mhash . crc32bzip2 crc32c crc32d crc32mpeg2 crc32posix crc32q crc32jamcrc crc32xfer crc40gsm crc64 crc64iso crc64we crc64jones For example: use crc_any::CRC; let mut crc64 = CRC::crc64(); crc64.update(b"hello"); After you get a CRC value, you can...
Crate
v3.1.0
2026-09-29
aminediro.com
...Traditionally, text search is usually done using some kind of exact matching or fuzzy matching algorithm with some sprinkled clever pre/post processing techniques like stemming, and lemmatization… All it can do is to check, at scale, whether a query matches some text and return the result. The big downside...
Observations/Thoughts
2024-01-17
~17 min read
rust-lang-nursery.github.io
...use std::time::Duration;
use tokio::time::timeout;
async fn fetch_network_request() -> u32 {
89
}
#[tokio::main]
async fn main() {
match timeout(Duration::from_millis(5), fetch_network_request()).await {
Ok(x) => println!("Received {x}"),
Err(_) => eprintln!("Timed Out!"),
}
}
Add tokio to Cargo.toml with the macros and time features...
The Rust Cookbook
Book
2024-01-01
~1 min read
github.com
...The bindings are checked in CI to ensure that what exists in git matches the output of the script. License This project is licensed under either of Apache License, Version 2.0, ( LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0 ) MIT license ( LICENSE-MIT or http://opensource...
Crate
v0.1.13+1.68.1
2026-03-31
doc.rust-lang.org
pub fn unwrap(self) -> T
...Instead, prefer to use the ? (try) operator, or pattern matching to handle the Err case explicitly, or call unwrap_or, unwrap_or_else, or unwrap_or_default.
Panics
Panics if the value is an Err, with a panic message provided by the Err's value.
Examples
Basic usage:
let x...
method
core
Stable since 1.0.0
Version 1.100.0-nightly
guillaumegomez.github.io
...and added ‘platform-specific’ section to sleep_ms to match sleep..
@jmdyck added a link to the second edition of The Book.
@steveklabnik fixed wording around sort guarantees.
@estebank taught diagnostics to highlight text and provided disambiguated syntax for candidates in E0034.
@APTy added docs and tests for join_multicast...
Other Weeklies from Rust Community
2017-01-17
~2 min read
rust-analyzer.github.io
...type mismatch with associated types.
#12427 fix VSCode config patching incorrectly patching some configs.
#12444 implement parsing of ? opt-out trait bounds.
#12467 fix Match to if-let assist for wildcard patterns.
#12470, #12472 avoid duplicating output channels when restarting the server.
#12471 restart the server instead of reloading the...
Project/Tooling Updates
2022-06-08
~1 min read
doc.rust-lang.org
pub fn split_paths<T>(unparsed: &T) -> SplitPaths<'_>
...Examples
use std::env;
let key = "PATH";
match env::var_os(key) {
Some(paths) => {
for path in env::split_paths(&paths) {
println!("'{}'", path.display());
}
}
None => println!("{key} is not defined in the environment.")
}
function
std
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn incoming(&self) -> Incoming<'_>
...TcpStream) {
//...
}
fn main() -> std::io::Result<()> {
let listener = TcpListener::bind("127.0.0.1:80")?;
for stream in listener.incoming() {
match stream {
Ok(stream) => {
handle_connection(stream);
}
Err(e) => { /* connection failed */ }
}
}
Ok(())
}
method
std
Stable since 1.0.0
Version 1.100.0-nightly
ryhl.io
...In the example above, we match on the enum inside a handle_message method on
the actor struct, but that isn't the only way to structure this. One could also
match on the enum in the run_my_actor function. Each branch in this match
could then call various...
Rust Walkthroughs
2021-02-17
~11 min read
www.redox-os.org
...The public key must match the
one installed on disk. The signature of the struct must verify against the
public key. If this is true, the hash and entry count are considered valid.
The entry metadata can now be downloaded to a temporary file. During the
download, the BLAKE3 hash...
News & Blog Posts
2020-03-17
~5 min read