#rust

60 articles about rust

gitSeptember 5, 2026

AI Commit Messages Without Handing Over Your Git History

AI git tooling tends to come in two shapes: a text box you copy out of, or an agent that runs commands and tells you afterwards. There is a third option, and it comes down to where the approval sits.

azureMay 29, 2026

AIS Runner: A Desktop GUI for Local Azure Logic Apps Standard Development

AIS Runner is a Dioxus-based desktop app for local Azure Logic Apps Standard development — manage, run, debug, and compare workflows without leaving your dev environment.

rustApril 14, 2026

What is `clamp` in Rust, and when should you use it?

What clamp does, why it panics on a swapped min and max, and how it differs from the saturating arithmetic it gets confused with.

rustMarch 31, 2026

What is &mut *x (reborrow) in Rust, and why does it freeze the original reference?

A reborrow duplicates the reference, not the data, and freezes the original for its duration. What &mut *x really does.

rustNovember 4, 2025

Instruction-Level Optimization: #[inline(always)]

Strategic application of Rust's #[inline(always)] attribute for instruction-level optimization, covering effective usage patterns and risks of overuse

rustNovember 4, 2025

Align data structures to cache lines

Designing cache-aligned data structures in multi-threaded Rust applications to prevent false sharing and optimize performance for large dataset processing

rustNovember 3, 2025

Mastering Inline Assembly in Rust: When and How to Optimize Safely

Low-level optimization in Rust, focusing on using inline assembly for performance-critical tasks

rustNovember 2, 2025

Understanding Rust Move Closures: A Guide for JavaScript Developers

Learn how Rust move closures work compared to JavaScript closures - ownership, threading, and when to use the move keyword

rustNovember 2, 2025

Profiling Rust: Tackling L1 Cache Misses with perf, Flamegraph, and Criterion

Low-level optimization in Rust, focusing on profiling tools to identify and fix performance bottlenecks like L1 cache misses

rustOctober 23, 2025

Boosting Rust Hot Loops: Slashing Branch Mispredictions

Low-level optimization in Rust, focusing on minimizing branch mispredictions in performance-critical loops

rustOctober 1, 2025

SIMD in Rust: Optimizing Matrix Multiplication

Leveraging Rust’s SIMD support for accelerating matrix multiplication with considerations for portability and correctness

rustSeptember 12, 2025

Zero-Cost Abstractions: How Rust Optimizes Iterator Chains

Low-level optimization in Rust, focusing on iterator chains and zero-cost abstractions

rustAugust 27, 2025

Vec::push() in a loop vs. pre-allocating with Vec::with_capacity()?

Comparing performance of Vec::push() in loops versus pre-allocating with Vec::with_capacity(), analyzing memory reallocation costs and optimization strategies

rustAugust 27, 2025

Avoiding heap allocation on a real-time path

Leveraging Rust's stack-based features like fixed-size arrays and Option to eliminate heap allocations in real-time systems for predictable, low-latency execution

rustAugust 17, 2025

Blanket implementations: one impl for every type that qualifies

Employing blanket implementations in Rust to minimize code duplication for maintainable libraries

rustAugust 16, 2025

Associated types vs. generics in a low-level I/O driver API

Utilizing associated types in Rust traits to design flexible, type-safe APIs for low-level I/O drivers and comparing advantages over generic type parameters

rustAugust 15, 2025

Deadlocks in C vs Rust: What Does Rust Really Prevent?

Deadlocks aren't prevented by compilers—but Rust adds safety guarantees that make writing deadlock-prone code harder. Here's how it compares to C.

rustAugust 15, 2025

?Sized: writing one function for both sized and unsized types

Understanding the role of ?Sized bounds in Rust trait definitions and leveraging them to create flexible functions that work with both sized and unsized types efficiently

rustAugust 14, 2025

Supertraits: enforcing a hierarchy of behaviours

Leveraging supertraits to establish behavior hierarchies and combining them with where clauses to optimize complex generic algorithms for performance and type safety

rustAugust 13, 2025

Making Traits Object-Safe for Rust's dyn Trait in Plugin Systems

Understanding object safety in Rust and refactoring traits for dynamic dispatch

rustAugust 12, 2025

Trait bounds or dyn Trait? Static and dynamic dispatch compared

Generics with a trait bound compile to static dispatch; dyn Trait compiles to a vtable lookup. What each costs, and how to choose.

rustAugust 11, 2025

Trait Bounds

Using trait bounds in Rust for type safety and performance in mathematical computations

rustAugust 10, 2025

Mutable vs. immutable borrows: the two rules

The two borrowing rules, why exclusivity is the one that matters, and what the borrow checker actually rejects.

rustAugust 10, 2025

Rust Operators & Iterators: Quick Reference

Essential Rust operators, iterator differences, and Unicode handling you need to know.

rustAugust 6, 2025

Where do string literals (&str) live?

String literals live in the binary's read-only data with a 'static lifetime — what that means for allocation, copying, and returning them.

rustAugust 5, 2025

What is the purpose of Box<T> in Rust?

What Box<T> is for, what the extra indirection costs, and when a heap allocation is the right call rather than a reflex.

rustAugust 4, 2025

Why &str Won't Fit &String in Rust: Fun Fixes for String Mismatches!

Why passing a &str where a &String is expected fails to compile, what deref coercion does and doesn't do, and how to fix the mismatch.

rustAugust 3, 2025

How does Rust prevent dangling pointer at compile time?

Why a dangling pointer is a compile error in Rust rather than a crash in production, and how lifetimes make that check possible.

rustAugust 2, 2025

How does ownership prevent memory leaks and data races?

How the ownership rules close off memory leaks and data races before the program ever runs, and where they stop short.

rustAugust 1, 2025

Stack vs. Heap in Rust: Where Does Your Data Live?

What actually decides whether a value lands on the stack or the heap in Rust, and what each choice costs you at runtime.

rustJuly 31, 2025

How does Rust ensure memory safety without a garbage collector?

Ownership, borrowing and lifetimes give Rust memory safety at compile time, with no collector and no runtime pauses to budget for.

rustJuly 30, 2025

How does Cow<'a, B> (Copy-on-Write) work in Rust?

Cow<'a, B> lets a function borrow when it can and allocate only when it must. How copy-on-write works and when it pays for itself.

rustJuly 30, 2025

Understanding the Drop Trait in Rust

How the Drop trait works, when the destructor runs, and why implementing it by hand is rarer than it looks.

rustJuly 30, 2025

How Rust's Ownership and Borrowing Ensure Safe Concurrency

Ownership and borrowing rule out data races at compile time. What Send and Sync add, and why Rc can't cross a thread boundary.

rustJuly 29, 2025

Flatten a Vec<Vec<T>> into a Vec<T> using iterators

Flattening Vec<Vec<T>> using iterators compared to manual concatenation, analyzing performance implications

rustJuly 28, 2025

Vec::retain() Vs filtering with iter().filter().collect()?

Comparing Vec::retain() in-place filtering with iter().filter().collect() for different filtering scenarios and performance implications

rustJuly 26, 2025

Vec::drain() Vs Vec::truncate() or Vec::clear()?

Understanding Vec::drain() functionality and comparing it with Vec::truncate() and Vec::clear() for different element removal scenarios

rustJuly 24, 2025

What is the difference between Box<[T]> and Vec<T>?

Comparing Box<[T]> and Vec<T> differences in mutability, memory overhead, and performance implications for different use cases

rustJuly 21, 2025

How do you remove duplicates from a Vec<T> where T: Eq + Hash?

Efficient approaches to remove duplicates from Vec<T> where T: Eq + Hash, comparing HashSet-based and sort-based methods with performance analysis

rustJuly 16, 2025

Rust's collect() Magic: Turning Iterators into Vecs, HashMaps, and Strings!

How collect() decides what to build, what FromIterator asks of the target type, and how to steer it towards a Vec, a HashMap or a String.

rustJuly 14, 2025

How do you store a closure in a struct?

Storing closures in structs using generic parameters, trait objects, and lifetime annotations with Fn, FnMut, and FnOnce bounds

rustJuly 14, 2025

Implications of iterating over a Vec with .into_iter() instead of .iter()

Understanding the differences between .into_iter() and .iter() when iterating over Vec, covering ownership implications and performance considerations

rustJuly 12, 2025

Rust's Higher-Order Functions: Powering Flexible Closures

Exploring higher-order functions in Rust for functional programming patterns

rustJuly 12, 2025

How do you handle lifetimes when returning a closure that captures variables from its environment?

Managing lifetimes when returning closures that capture variables, covering ownership transfer, lifetime annotations, and avoiding dangling references in Rust

rustJuly 12, 2025

Using closures versus regular functions ?

Analyzing performance overhead of closures versus regular functions in Rust, covering static dispatch, heap allocation, and optimization scenarios

rustJuly 10, 2025

Rust's Stateful Closures: Passing and Mutating Across Multiple Calls

Managing stateful closures in Rust for repeated function calls

rustJuly 9, 2025

impl Fn() vs. Box<dyn Fn()>: Rust's Closure Dispatch Showdown

Comparing static and dynamic dispatch for closures in Rust, focusing on performance and use cases

rustJuly 8, 2025

What are move closures (move || { ... })? When are they necessary, and how do they interact with ownership?

What move actually moves, when you genuinely need it (threads, returned closures, async blocks), and how it interacts with ownership.

rustJuly 8, 2025

How do into_iter(), iter(), and iter_mut() differ?

into_iter(), iter() and iter_mut() differ in what they hand you: the value, a shared reference, or an exclusive one.

rustJuly 7, 2025

What are the differences between Fn, FnMut, and FnOnce?

Fn, FnMut and FnOnce aren't traits you pick — the compiler derives them from how the closure uses what it captured.

rustJuly 7, 2025

How do you specify a closure as a function parameter or return type?

Taking and returning closures: when impl Fn is enough, when you need Box<dyn Fn>, and what each choice costs at the call site.

rustJuly 4, 2025

Rust Traits vs. Java/C# Interfaces: Shared Behavior Done Right

Discussion on Rust traits vs Java/C# interfaces, covering dispatch mechanisms, compile-time behavior, and performance optimizations.

rustJuly 3, 2025

String vs. &str – Which to Use and When?

String vs str in Rust, covering memory management, ownership, and when to use each type.

rustJune 30, 2025

Functions or Closures in Rust? Know the Difference!

Functions vs closures in Rust, covering ownership, traits, lifetimes, and performance implications.

rustJune 26, 2025

Rust's repr: Optimize Struct Memory for Cache Efficiency

Low-level memory optimization in Rust, covering repr attributes, cache efficiency, and performance trade-offs

rustJune 25, 2025

Rust Vec::new() vs. with_capacity(): When to Use Each

Vec allocation strategies in Rust, comparing Vec::new() and Vec::with_capacity() for optimal performance.

rustApril 15, 2025

Getting Started with Rust: A Guide for Beginners

Introduction to Rust for beginners, covering installation, basic syntax, and your first project.

rustApril 12, 2025

Rust: Memory Safety Without Garbage Collection

Rust gives you the performance of C with memory safety enforced at compile time. Learn how ownership and borrowing eliminate entire bug classes.

rustApril 11, 2025

C Gives You Control, But at What Cost?

C avoids garbage collection and gives manual memory control, but opens the door to dangerous bugs. Explore real-world memory issues and why they matter.

rustApril 10, 2025

GC Pauses and Latency: The Hidden Cost of High-Level Languages

Java, Python, and JavaScript offer convenience, but garbage collection introduces unpredictable latency. Explore how runtime memory management affects performance in real systems.