Rust Search

Find the best content on Rust, curated by the community; a search engine for Rustaceans.
mobiarch.wordpress.com
...fn make_dir(path: &str) -> std::io::Result<()> { let err = match std::fs::create_dir(path) { Ok(_) => return Ok(()), Err(e) => e }; match err.kind() { ErrorKind::AlreadyExists => return Ok(()), _ => { println!("Failed to create directory: {}", path); return Err(err); } }; } getenv Use std::env:var. if let Ok(val) = std::env::var...
From the Blogosphere 2015-07-13 ~2 min read
kerkour.com
...fn do_something() -> Result<(), Error> { let user = get_user_opt().ok_or(Error::UserNotFound)?; // do something } match Then, of course, there is match: fn do_something() -> Result<(), Error> { let user = match get_user_opt() { Some(user) => user, None => return Err(Error::UserNotFound); }; // do something } if let / let else Even better...
Observations/Thoughts 2026-10-21 ~7 min read
hirrolot.github.io
...for S<Lhs> is the induction step (recursion case) – similar to how we did with pattern matching using match. Likewise, as in the first example, the induction works by reducing the first argument to Z: <Lhs as Add<Rhs>>::Result works just like add(next, rhs) – it invokes pattern matching...
Observations/Thoughts 2022-01-26 ~30 min read
rust-lang-nursery.github.io
...badge]][cat-text-processing] | | Extract phone numbers from text | [![regex-badge]][regex] | [![cat-text-processing-badge]][cat-text-processing] | | Filter a log file by matching multiple regular expressions | [![regex-badge]][regex] | [![cat-text-processing-badge]][cat-text-processing] | Replace all occurrences of one text pattern with another pattern. | [![regex-badge...
The Rust Cookbook Book 2024-01-01 ~1 min read
docs.rs
...extern crate unicode_normalization_alignments; use unicode_normalization_alignments::char::compose; use unicode_normalization_alignments::UnicodeNormalization; fn main() { assert_eq!(compose('A','\u{30a}'), Some('Å')); let s = "ÅΩ"; let c = s.nfc().map(|(c, diff)| { match diff { 0 => println!("Nothing changed here"), 1 => println!("New character"), _ => println!("{} characters were...
Crate v0.1.12 2019-12-30
crates.io
...Currently a lot of documentation is rather terse, referring to the matching methods on the string types in the standard library is best in those cases. Feel free to contribute more exhaustive in-line docs.
Crate v0.2.0 2020-10-10
EuroRust www.youtube.com
...We’ll walk through the missteps, the initial design we implemented and then discarded, the profiling rabbit holes, and the eventual breakthroughs that led us to a Rust version that not only matched but outperformed the original, without compromising safety and memory usage. Along the way, we’ll cover design...
Talk Luca Palmieri 2025-10-09
RustConf www.youtube.com
...We’ll walk through the missteps, the initial design we implemented and then discarded, the profiling rabbit holes, and the eventual breakthroughs that led us to a Rust version that not only matched but outperformed the original, without compromising safety and memory usage. Along the way, we’ll cover design...
Talk Luca Palmieri 2025-09-03
felix-knorr.net
...So I needed to transform my handler functions so that their return type matches. In Python I would've used a decorator function for that: def eat_error(f): def inner(*args, **kwargs): return some_transformation(f(*args, **kwargs)) return inner And I knew that there was this one type...
Rust Walkthroughs 2022-10-19 ~6 min read
www.rustydonkey.dev
...All the same numeric comparisons are supported here too! Text Matching: This one is really cool! You can find text that: is exactly a certain string starts with a substring ends with a substring contains a substring Hierarchy: You can now also filter directly by an item's class and...
Project/Tooling Updates 2025-10-29 ~4 min read
arzg.github.io
...Let’s add a todo!() and comment out the rest so we can get on with running our tests:impl Expr { // snip pub(crate) fn eval(&self, env: &Env) -> Result<Val, String> { match self { Self::Number(Number(n)) => Ok(Val::Number(*n)), Self::Operation { lhs, rhs, op } => { todo!(); // let Number...
Learn More Rust 2020-10-14 ~25 min read
adventures.michaelfbryan.com
...std::slice::Iter<'src, Operation>, } Turning TextObjectParser into an Iterator turned out to be pretty easy thanks to pattern matching. I know ahead of time exactly which operations I’m looking for and what their operands will be so each pattern can be its own branch in a big match...
Rust Walkthroughs 2021-02-03 ~13 min read
minikin.me
...Presence<T>) { match update { Presence::Absent => {}, // Field missing from JSON → no change Presence::Null => *target = None, // Field is null in JSON → clear Presence::Some(v) => *target = Some(v), // Field has value → set it } } fn apply_patch(user: &mut User, patch: UserPatch) { apply_field(&mut user.name, patch.name); apply_field...
Rust Walkthroughs 2025-12-17 ~7 min read
blog.jetbrains.com
...When the output is not what you expected, it can be hard to see how the input matches the macro definition and what code the macro produced. The new interactive declarative macro tester shows you the code your macro input expands into, as well as how the input and output...
Project/Tooling Updates 2026-07-22 ~4 min read
docs.rs
...Example match rexif::parse_file(&file_name) { Ok(exif) => { println!("{} {} exif entries: {}", file_name, exif.mime, exif.entries.len()); for entry in &exif.entries { println!(" {}: {}", entry.tag, entry.value_more_readable); } }, Err(e) => { eprintln!("Error in {}: {} {}", &file_name, Error::description(&e), e.extra).unwrap(); } } The src/main.rs file is...
Crate v0.7.6 2026-10-13
docs.rs
...ChannelBuilderError> { Ok(Channel { id: match self.id { Some(ref value) => Clone::clone(value), None => { return Err( Into::into( ::derive_builder::UninitializedFieldError::from("id"), ), ) } }, token: match self.token { Some(ref value) => Clone::clone(value), None => { return Err( Into::into( ::derive_builder::UninitializedFieldError::from("token"), ), ) } }, special_info: match self.special_info { Some...
Crate v0.20.2 2024-10-08
arXiv arxiv.org
...This work investigates aforementioned features, in particular pattern matching, providing a consistent view on how to apply MC/DC to Rust. Hence, this paper informs the implementation of Rust MC/DC tools, paving the road towards Rust in high-assurance applications.
Software Engineering Wanja Zaeske, Pietro Albini, Florian Gilcher et al. 2024-09-13 arXiv:2409.08708
dev.to
...diesel::result::Error, context: &str) -> AppError { AppError::new( format!("{}: {}", context, err.to_string()).as_str(), match err { diesel::result::Error::DatabaseError(db_err, _) => { match db_err { diesel::result::DatabaseErrorKind::UniqueViolation => ErrorType::BadRequest, _ => ErrorType::Internal, } } diesel::result::Error::NotFound => ErrorType::NotFound, // Here we can handle other cases if needed _ => { ErrorType::Internal...
Learn More Rust 2020-08-04 ~20 min read
www.youtube.com
...So you generally don't have to normalize except when you actually match on the type kind in which case you have to make sure that your call tries to actually resolve ideally as close to the uh match on the kind as possible to make sure that well uh...
Video 2025-06-04
matthewkmayer.github.io
...database_instance_name.to_string(), db_instance_class: "db.t2.micro".to_string(), // name and login details should match `.env` in rusoto-rocket master_user_password: Some("TotallySecurePassword501".to_string()), master_username: Some("masteruser".to_string()), db_name: Some("rusotodb".to_string()), engine: "postgres".to_string(), multi_az: Some(false...
News & Blog Posts 2017-05-23 ~9 min read
"For me, acquiring a taste for rustfmt-style seems worthwhile to 'eliminate broad classes of debate', even if I didn't like some of the style when I fi..."

Search tips

Type anything to search across articles, videos (including conference talks), podcasts, research, crates, and Rust API documentation. These operators give you finer control — click an example to try it.

Find pages containing all your words. Pages where the words appear together rank higher.
Quote part of your query to keep those words together as an exact phrase within a larger search.
Wrap the whole query in quotes for a verbatim search that matches text exactly, punctuation and all — perfect for Rust syntax. Needs at least 3 characters.
Put ! first to open the top result immediately. Quote the whole query for a literal leading bang, as in '!Send'. Bangs elsewhere, such as println!, stay literal. Browser and launcher shortcuts can invoke this directly. See search integrations.
Limit results to a single site. Works on its own () too. One site: per search.

Use the tabs and filters above the results to narrow by content type, publication year, and sort order.