Rust is well-known for its performance and memory safety. This is one of the primary reasons we chose rust to build the inspektor's dataplane. So

use unchecked_unwrap in rust to go fast

submited by
Style Pass
2022-05-13 12:30:04

Rust is well-known for its performance and memory safety. This is one of the primary reasons we chose rust to build the inspektor's dataplane. So that we can extract as much performance as we can from the machine.

unwrap is a method in the Option enum that most rustaceans are familiar with. The unwrap function will determine whether the Option enum is None or Some. If the variant is Some, then returns the value. Otherwise, it throws panic.

To avoid pattern matching, it's common practice to use unwrap when the developer knows the Option enum is of the Some variant.

Leave a Comment