Skip to main content
TopMiniSite

Back to all posts

What Does ?? Do In Rust?

Published on
5 min read
What Does ?? Do In Rust? image

Best Rust Tools to Buy in November 2025

1 PowerMate Vx 024-0299CT Air Needle Scaler

PowerMate Vx 024-0299CT Air Needle Scaler

  • 19 STEEL NEEDLES DELIVER POWERFUL SCALING FOR FAST SURFACE PREP.
  • ADJUSTABLE SPEED CONTROL FOR TAILORED PERFORMANCE ON EVERY JOB.
  • PISTOL GRIP DESIGN ENSURES SUPERIOR CONTROL AND COMFORT WHILE WORKING.
BUY & SAVE
$36.58
PowerMate Vx 024-0299CT Air Needle Scaler
2 Rocaris 6 Pack Carbon Steel Wire Wheel and Pen Brush Set with 1/4-Inch Hex Shank for Rust Removal, Corrosion and Scrub Surfaces

Rocaris 6 Pack Carbon Steel Wire Wheel and Pen Brush Set with 1/4-Inch Hex Shank for Rust Removal, Corrosion and Scrub Surfaces

  • VERSATILE 6-PACK FOR POWER DRILLS; TACKLE ANY CLEANING TASK EASILY!

  • PREMIUM BLACK STEEL WIRE ENSURES DURABILITY AND SUPERIOR PERFORMANCE.

  • REMOVE RUST, PAINT, AND CORROSION EFFORTLESSLY IN HARD-TO-REACH AREAS!

BUY & SAVE
$7.69
Rocaris 6 Pack Carbon Steel Wire Wheel and Pen Brush Set with 1/4-Inch Hex Shank for Rust Removal, Corrosion and Scrub Surfaces
3 CRC Evapo-Rust, Heavy-Duty Rust Remover, Reusable, Acid-Free, Non-Corrosive, Water-based, 32 oz, Removes Rust to Bare Metal

CRC Evapo-Rust, Heavy-Duty Rust Remover, Reusable, Acid-Free, Non-Corrosive, Water-based, 32 oz, Removes Rust to Bare Metal

  • EFFORTLESSLY REMOVES RUST WITH NO SCRUBBING OR SANDING NEEDED.

  • SAFE, WATER-BASED FORMULA-NO HARMFUL CHEMICALS OR ODORS!

  • VERSATILE FOR USE ON ALL METAL, FROM TOOLS TO ANTIQUES.

BUY & SAVE
$13.85
CRC Evapo-Rust, Heavy-Duty Rust Remover, Reusable, Acid-Free, Non-Corrosive, Water-based, 32 oz, Removes Rust to Bare Metal
4 Evapo-Rust ER012 Heavy Duty – 128 oz., Rust Remover for Auto Parts, Hardware, Antiques | Rust Removers and Chemicals

Evapo-Rust ER012 Heavy Duty – 128 oz., Rust Remover for Auto Parts, Hardware, Antiques | Rust Removers and Chemicals

  • EFFORTLESSLY REMOVES RUST-NO SCRUBBING OR SANDING NEEDED!
  • SAFE, NON-TOXIC, AND WATER-BASED FOR ALL METAL TYPES.
  • VERSATILE USE FOR AUTOMOTIVE, COOKWARE, TOOLS, AND ANTIQUES.
BUY & SAVE
$29.95 $34.98
Save 14%
Evapo-Rust ER012 Heavy Duty – 128 oz., Rust Remover for Auto Parts, Hardware, Antiques | Rust Removers and Chemicals
5 Oil Eater Overnight Rust Remover - Safe & Easy Soak for Tools, Auto Parts, Antiques, 32oz Concentrate - Makes 1-Gallon

Oil Eater Overnight Rust Remover - Safe & Easy Soak for Tools, Auto Parts, Antiques, 32oz Concentrate - Makes 1-Gallon

  • RUST-SOAK TECHNOLOGY: SAFELY DISSOLVES RUST FOR VARIOUS METAL ITEMS!

  • EFFORTLESS SOAK: JUST SOAK, RINSE, AND REVEAL RESTORED METAL-NO SCRUBBING!

  • ECO-FRIENDLY FORMULA: BIODEGRADABLE, SAFE RUST REMOVAL WITHOUT HARSH CHEMICALS.

BUY & SAVE
$9.18
Oil Eater Overnight Rust Remover - Safe & Easy Soak for Tools, Auto Parts, Antiques, 32oz Concentrate - Makes 1-Gallon
6 13 Pack Carbon Steel Wire Wheel Brush Set, Wire Brush for Drill, Nylon/Brass/Stainless Steel Bristles Cleaning Supplies Tools Brush for Cleaning Rust, Dirt, Paint Scrubbing, Kitchen, Home

13 Pack Carbon Steel Wire Wheel Brush Set, Wire Brush for Drill, Nylon/Brass/Stainless Steel Bristles Cleaning Supplies Tools Brush for Cleaning Rust, Dirt, Paint Scrubbing, Kitchen, Home

  • VERSATILE 13-PIECE SET: INCLUDES BRUSHES FOR ALL SURFACES AND TASKS.

  • DURABLE PERFORMANCE: HIGH-QUALITY MATERIALS ENSURE LONG-LASTING USE.

  • LIFETIME WARRANTY: ERGONOMIC DESIGN BOOSTS COMFORT AND EFFICIENCY.

BUY & SAVE
$13.99 $17.99
Save 22%
13 Pack Carbon Steel Wire Wheel Brush Set, Wire Brush for Drill, Nylon/Brass/Stainless Steel Bristles Cleaning Supplies Tools Brush for Cleaning Rust, Dirt, Paint Scrubbing, Kitchen, Home
7 Lodge Cast Iron Rust Eraser - 1 Each

Lodge Cast Iron Rust Eraser - 1 Each

  • RESTORE LODGE CAST IRON COOKWARE WITH PRECISION AND EASE.
  • ESSENTIAL TOOL FOR REVIVING CHERISHED FAMILY HEIRLOOMS.
  • MADE IN USA; NEEDS RE-SEASONING AFTER RUST REMOVAL.
BUY & SAVE
$9.90
Lodge Cast Iron Rust Eraser - 1 Each
8 Pylevemv 6Pcs Professional Wire Wheel, Carbon Steel Wire Brush for Drill, Drill Cup Brush for Cleaning Rust, Wire Brush Drill Attachments with 1/4 Inch Hex Shank

Pylevemv 6Pcs Professional Wire Wheel, Carbon Steel Wire Brush for Drill, Drill Cup Brush for Cleaning Rust, Wire Brush Drill Attachments with 1/4 Inch Hex Shank

  • VERSATILE SET: 6 ESSENTIAL WIRE BRUSHES FOR ALL CLEANING TASKS.

  • PRECISE POLISHING: ACHIEVE SMOOTH FINISHES ON METAL, WOOD, AND STONE.

  • EFFORTLESS RUST REMOVAL: QUICKLY RESTORE TOOLS AND SURFACES WITH EASE.

BUY & SAVE
$6.16 $6.78
Save 9%
Pylevemv 6Pcs Professional Wire Wheel, Carbon Steel Wire Brush for Drill, Drill Cup Brush for Cleaning Rust, Wire Brush Drill Attachments with 1/4 Inch Hex Shank
9 LAIWOO 16 Pack 2" Purple Nylon Coarse Grit Strip Discs for Drill, Paint Remover, Weld Cleaning, Rust Removal

LAIWOO 16 Pack 2" Purple Nylon Coarse Grit Strip Discs for Drill, Paint Remover, Weld Cleaning, Rust Removal

  • HIGH-STRENGTH BLACK DIAMOND ABRASIVE FOR SUPERIOR PERFORMANCE.

  • VERSATILE 3 SIZE FITS ANY 1/4 POWER DRILL FOR EASY USE.

  • PERFECT FOR REMOVING PAINT, GLUE, AND CLEANING METAL SURFACES.

BUY & SAVE
$13.49
LAIWOO 16 Pack 2" Purple Nylon Coarse Grit Strip Discs for Drill, Paint Remover, Weld Cleaning, Rust Removal
+
ONE MORE?

The ?? operator in Rust is used for error handling and helps facilitate concise and clean code when dealing with Result types. It is known as the "try operator" and can be used to quickly handle errors by unwrapping the Ok variant if it is present or returning the Err variant if an error occurs. This operator saves developers from having to write lengthy match expressions or unwrap() calls, making code more readable and maintainable.

What does short-circuiting mean when using the ?? operator in Rust?

Short-circuiting refers to the behavior of the ?? operator in Rust to only evaluate the right-hand side expression if the left-hand side expression returns an Err value. If the left-hand side expression returns an Ok value, the ?? operator will simply unwrap and return the inner value without evaluating the right-hand side expression. This can help streamline error handling code and prevent unnecessary computations if an error occurs.

What does the ?? operator do when encountering a None or Err value in Rust?

In Rust, the ?? operator is used to handle Result and Option types in a concise way. When encountering a None or Err value, the ?? operator will automatically return from the function with the value inside the None or Err and propagate the error. This eliminates the need for explicit error handling code in many cases and makes the code more readable and concise.

How to chain multiple errors using the ?? operator in Rust?

In Rust, the ?? operator can be used to chain multiple errors when working with Result types. Here is an example showing how to use the ?? operator to chain multiple errors:

use std::fs::File; use std::io::{self, Read};

fn read_file_contents(filename: &str) -> io::Result { let mut file = File::open(filename)?;

let mut contents = String::new();
file.read\_to\_string(&mut contents)?;

Ok(contents)

}

fn main() { let filename = "non_existent_file.txt"; let result = read_file_contents(filename);

match result {
    Ok(contents) => println!("File contents: {}", contents),
    Err(err) => eprintln!("Error reading file: {}", err),
}

}

In this example, the read_file_contents function attempts to open a file and read its contents, and uses the ?? operator to chain multiple possible errors that may occur during file operations. If an error occurs at any step, the error is propagated up to the caller of the function, and can be handled in the main function.

By chaining errors using the ?? operator, we can simplify error handling when working with Result types in Rust.

How to handle errors in combination with pattern matching and the ?? operator in Rust?

In Rust, pattern matching and the ?? operator can be used together to handle errors in a concise and expressive way. Here's an example of how you can handle errors using pattern matching and the ?? operator:

use std::fs::File; use std::io::{self, Read};

fn read_file_contents(filename: &str) -> Result<String, io::Error> { let mut file = File::open(filename)?;

let mut contents = String::new();
file.read\_to\_string(&mut contents)?;

Ok(contents)

}

fn main() { match read_file_contents("test.txt") { Ok(contents) => println!("File contents: {}", contents), Err(e) => eprintln!("Error reading file: {}", e), } }

In this example, the read_file_contents function attempts to open a file and read its contents. The ? operator is used to propagate any errors that occur during the file opening and reading process. If an error occurs, the function will return an Err variant containing the error.

In the main function, we use pattern matching to handle the result of calling read_file_contents. If the function returns Ok(contents), we print the file contents. If it returns Err(e), we print an error message containing the error.

By combining pattern matching and the ?? operator, you can write clean and concise error handling code in Rust.

What is the difference between the try! macro and the ?? operator in Rust?

The main difference between the try! macro and the ?? operator in Rust is how they handle errors in the code.

The try! macro is used to simplify error handling in Rust by propagating errors up the call stack. It essentially expands into a match expression that checks if the Result returned by the function call is an Ok value or an Err value. If it is an Ok value, the macro returns the inner value. If it is an Err value, the macro returns early with the Err value.

On the other hand, the ?? operator is used for the same purpose but it was introduced as a more concise way to handle errors in Rust. When used, it behaves similarly to the try! macro but with a more compact syntax. It can only be used in functions that return a Result type, and it will automatically propagate any errors in a more concise and readable way.

In summary, both the try! macro and the ?? operator are used for error handling in Rust, but the ?? operator provides a more concise and readable way to handle errors compared to the try! macro.