Archives
2026
Jun 15
204. take_while / skip_while — Act on the Leading Run, Not Every MatchJun 15
203. Peekable::next_if_map — Consume a Token Only If It Parses, Transform in One StepJun 14
202. Arc::clone Is a Refcount Bump, Not a Deep Copy — Share Big Data, Don't Duplicate ItJun 14
201. or_insert vs or_insert_with — Don't Build a Default You'll Throw AwayJun 13
200. #[derive(Copy)] and #[inline] — Make Small Types Free to Pass AroundJun 13
199. Static Dispatch — Generics Beat Box<dyn Trait> When You Can Afford the CodeJun 12
198. into_iter() to Transform — Move Owned Items Instead of cloned()Jun 12
197. Advance a State Machine with mem::replace — Move the Enum Out, No CloneJun 11
196. Return impl Iterator, Not Vec — Let the Caller Decide What to DoJun 11
195. Chain Iterator Adapters — Don't collect() Between Every StepJun 10
194. Reuse One Buffer with .clear() — Allocate Once, Loop Many TimesJun 10
193. Vec::with_capacity — Size Up Front, Skip the Realloc ChurnJun 09
192. impl Into<String> — Take Owned or Borrowed Without an Extra AllocationJun 09
191. Accept &str, Not String — Take the Most General BorrowJun 08
190. Return Cow<str> — Allocate Only When You Actually Change SomethingJun 08
189. str::char_indices — Slice a String Without Panicking on Non-ASCIIJun 07
188. LazyLock::from — Skip the Closure When You Already Have the ValueJun 07
187. fmt::Write — Stop Allocating a Temp String Just to Append ItJun 06
186. str::split_inclusive — Split a String and Keep the Separator With Each ChunkJun 06
185. Range<NonZeroU32> — Iterate NonZero Integers Without Re-Wrapping Every StepJun 05
184. Option::take — The Ergonomic Sibling of mem::take, Just for OptionJun 05
183. std::mem::take — Move Out of &mut self Without the CloneJun 04
182. Path::with_extension — Swap a File Extension Without Slicing StringsJun 04
181. Option::get_or_insert_with — Lazy Default That Returns &mutJun 03
180. Option::unzip — Split an Optional Pair Into a Pair of OptionsJun 03
179. Iterator::max_by_key — Find the Best Element Without a Manual FoldJun 02
178. Ord::clamp — Stop Writing min(max, max(min, x))Jun 02
177. BTreeMap::range — Iterate a Sorted Map by Key RangeJun 01
176. Option::as_deref — Stop Writing .as_ref().map(|s| s.as_str())Jun 01
175. PathBuf::push — When an Absolute Argument Wipes Your Base PathMay 31
174. iter::repeat_with — Build N Fresh Things When vec![] Won't CloneMay 31
173. NonZeroU32 and Friends — Encode an Invariant and Shrink Option for FreeMay 30
172. #[track_caller] — Point the Panic at the Caller, Not Your HelperMay 30
171. assert_matches! — A Test Failure That Actually Tells You What Went WrongMay 29
170. Ordering::then_with — Chain Comparators for Multi-Key SortsMay 29
169. File::create_new — Atomic 'Create Only If It Doesn't Exist'May 28
168. collect::<Result<Vec<_>, _>>() — Bail an Iterator on the First ErrorMay 28
167. Saturating<T> — Stop Calling .saturating_add() EverywhereMay 27
166. Entry::and_modify — Update If Present, Insert If Not, in One ChainMay 27
165. PhantomData<T> — The Zero-Sized Marker That Pretends to Own a TMay 26
162. Pin<P> — The Pointer Type That Says 'This Won't Move'May 26
164. Pin projection — How to actually use the fields behind Pin<&mut Self>May 26
163. Cow::to_mut — Lazy In-Place Mutation Through CowMay 25
161. Weak<T> — The Non-Owning Pointer That Breaks Rc CyclesMay 24
160. Arc<T> — Atomic Reference Counting for Threads, Plus Mutex and RwLockMay 24
159. Rc<T> — Single-Threaded Shared OwnershipMay 23
158. OnceLock<T> and LazyLock<T, F> — The std Replacements for lazy_static!May 23
157. Atomic* — The Thread-Safe Cell for ScalarsMay 22
156. RwLock<T> — Many Readers OR One Writer, When Reads DominateMay 22
155. Mutex<T> — Cross-Thread Exclusive Access, With a Guard Instead of a PanicMay 21
154. UnsafeCell<T> — The Primitive Every Interior-Mutability Type Is Built OnMay 21
153. OnceCell<T> — Memoize Through &self Without Wrapping in RefCellMay 20
152. RefCell<T> — When You Need to Actually Borrow the InsideMay 20
151. Cell<T> — Interior Mutability Without the Borrow Checker DramaMay 19
150. Vec::spare_capacity_mut — Fill a Vec From a Callback Without Zeroing It FirstMay 19
149. OnceLock::wait — Block a Thread Until Another One Initializes the ValueMay 18
148. Result::is_ok_and — Test the Variant and the Value in One CallMay 18
146. char::MAX_LEN_UTF8 — Size UTF-8 Buffers Without Magic NumbersMay 18
147. Cell::as_array_of_cells — Mutate One Slot of a Cell-Wrapped ArrayMay 17
143. Vec::dedup_by_key — Collapse Consecutive Duplicates by a Derived KeyMay 17
145. Duration::from_nanos_u128 — Round-Trip Nanoseconds Without the u64 CastMay 17
144. Vec::into_raw_parts — Hand a Vec to C Without the ManuallyDrop DanceMay 16
142. Path::absolute — Make a Path Absolute Without Touching the FilesystemMay 15
141. BinaryHeap::into_sorted_vec — Heapsort in One CallMay 15
140. slice::as_array — Lock a Slice Into a Fixed-Size Array ReferenceMay 14
139. HashMap::extract_if — Drain Matching Entries Without Losing ThemMay 14
138. iter::zip — Parallel Iteration Without the Method-Chain DanceMay 13
137. Vec::retain_mut — Filter and Edit In Place, In One PassMay 13
136. LazyLock::force_mut — Mutate a Lazy Value Without Wrapping It in a MutexMay 12
135. str::strip_prefix — Trim a Prefix Without Slicing by HandMay 12
134. Iterator::find_map — Find and Transform in One PassMay 11
133. slice::rotate_left — Cycle Elements Through a Slice Without a Second BufferMay 11
132. abs_diff — Subtract Without Caring Which Side Is BiggerMay 10
131. mem::offset_of! — Byte Offsets Without the memoffset CrateMay 10
129. BTreeMap::extract_if — Range-Scoped Filter-and-Remove in One PassMay 10
130. mem::discriminant — Compare Enum Variants, Ignore the PayloadMay 09
128. slice::copy_within — Shift Bytes In-Place Without Fighting the Borrow CheckerMay 08
127. std::mem::swap — Trade Two Values Through Their &mutMay 08
126. Vec::split_off — Cut a Vec in Two and Keep Both HalvesMay 07
125. RwLockWriteGuard::downgrade — Hand a Write Lock Off as a Read, AtomicallyMay 07
124. Iterator::cycle — Round-Robin Without the Modulo MathMay 06
123. BTreeMap::pop_first — A Sorted Map That Doubles as a Priority QueueMay 06
122. Option::filter — Keep Some Only When the Value PassesMay 05
121. rem_euclid — The Modulo That Doesn't Go NegativeMay 05
120. OnceLock — Lazy Statics That Initialize on Your ScheduleMay 04
119. iter::from_fn — Build a Custom Iterator Without the StructMay 04
118. [T; N]::map — Transform an Array Without Allocating a VecMay 03
117. Iterator::step_by — Every Nth Element Without filter + enumerateMay 03
116. Path::file_prefix — Get the Real Stem of archive.tar.gzMay 02
115. Vec::resize_with — Grow a Vec With a Closure, Not a CloneMay 02
114. Option::transpose — Use ? on an Optional ResultMay 01
113. Arc::make_mut — Mutate Inside an Arc Without the DanceMay 01
112. Iterator::scan — Fold That Yields Every StepApr 30
111. Vec::insert_mut — Splice In and Edit Without ReindexingApr 30
110. slice::split_at_checked — Split Without the PanicApr 29
109. BinaryHeap::peek_mut — Edit the Top Without Pop-and-PushApr 29
108. Iterator::max_by_key — Find the Biggest Without Sorting the Whole ThingApr 28
107. Vec::splice — Replace a Range and Keep the Old ValuesApr 28
106. Iterator::by_ref — Take Part of an Iterator and Keep the RestApr 27
105. Vec::extend_from_within — Duplicate a Range Without Fighting the Borrow CheckerApr 27
103. bool::then_some — Turn a Condition Into an Option Without an ifApr 26
104. Vec::swap_remove — O(1) Removal When Order Doesn't MatterApr 25
102. slice::partition_point — Binary Search That Just Returns the IndexApr 24
101. f64::total_cmp — Sort Floats Without the NaN PanicApr 24
100. std::cmp::Reverse — Sort Descending Without Writing a ClosureApr 23
99. std::mem::replace — Swap a Value and Keep the Old OneApr 23
98. sort_by_cached_key — Stop Recomputing Expensive Sort KeysApr 22
97. Option::take_if — Take the Value Out Only When You Want ToApr 22
96. Result::inspect_err — Log Errors Without Breaking the ? ChainApr 21
95. LazyLock::get — Peek at a Lazy Value Without Initializing ItApr 21
94. ControlFlow::is_break and is_continue — Ask the Flow Which Way It WentApr 20
93. MaybeUninit Array Conversions — Build Fixed Arrays Without transmuteApr 20
92. core::range — Range Types You Can Actually CopyApr 19
91. bool::try_from — Convert Integers to Booleans SafelyApr 19
90. black_box — Stop the Compiler From Erasing Your BenchmarksApr 18
89. cold_path — Tell the Compiler Which Branch Won't HappenApr 18
88. Vec::push_mut — Push and Modify in One StepApr 17
87. Atomic update — Kill the Compare-and-Swap LoopApr 17
86. cfg_select! — Compile-Time Match on Platform and FeaturesApr 16
85. cast_signed & cast_unsigned — Explicit Sign Casting for IntegersApr 16
84. Result::flatten — Unwrap Nested Results in One CallApr 15
83. Arc::unwrap_or_clone — Take Ownership Without the DanceApr 15
82. isqrt — Integer Square Root Without Floating PointApr 14
81. checked_sub_signed — Subtract a Signed Delta From an Unsigned Without CastsApr 14
80. VecDeque::pop_front_if and pop_back_if — Conditional Pops on Both EndsApr 13
79. #[diagnostic::on_unimplemented] — Custom Error Messages for Your TraitsApr 13
78. div_ceil — Divide and Round Up Without the Overflow BugApr 12
77. repeat_n — Repeat a Value Exactly N TimesApr 12
76. slice::as_chunks — Split Slices into Fixed-Size ArraysApr 11
75. select_nth_unstable — Find the Kth Element Without SortingApr 11
74. slice::is_sorted — Ask the Slice if It's Already SortedApr 10
73. u64::midpoint — Average Two Numbers Without OverflowApr 10
72. if let Guards — Pattern Match Inside Match GuardsApr 09
71. Inline const Blocks — Compile-Time Evaluation AnywhereApr 09
70. Iterator::intersperse — Join Elements Without Collecting FirstApr 08
69. Iterator::try_fold — Fold That Knows When to StopApr 08
68. f64::next_up — Walk the Floating Point Number LineApr 07
67. Box::leak — Turn Owned Data Into a Static ReferenceApr 07
66. Inferred Const Generics — Let the Compiler Count For YouApr 06
65. Precise Capturing — Stop impl Trait From Borrowing Too MuchApr 06
64. Iterator::unzip — Split Pairs into Separate CollectionsApr 05
63. fmt::from_fn — Display Anything With a ClosureApr 05
62. Iterator::flat_map — Map and Flatten in One StepApr 04
61. Iterator::reduce — Fold Without an Initial ValueApr 04
60. Iterator::partition — Split a Collection in TwoApr 03
59. split_first_chunk — Destructure Slices into ArraysApr 03
58. Option::is_none_or — The Guard Clause You Were MissingApr 02
57. New Math Constants — GOLDEN_RATIO and EULER_GAMMA in stdApr 02
56. Iterator::map_while — Take While TransformingApr 01
55. floor_char_boundary — Truncate Strings Without Breaking UTF-8Apr 01
54. Cell::update — Modify Interior Values Without the GymnasticsMar 31
53. element_offset — Find an Element's Index by ReferenceMar 31
52. Peekable::next_if_map — Peek, Match, and Transform in One StepMar 30
51. File::lock — File Locking in the Standard LibraryMar 30
50. slice::chunk_by — Group Consecutive ElementsMar 29
49. std::io::pipe — Anonymous Pipes in the Standard LibraryMar 29
48. #[expect] — Lint Suppression That Cleans Up After ItselfMar 28
47. Vec::pop_if — Conditionally Pop the Last ElementMar 28
46. Let Chains — Flatten Nested if-let with &&Mar 27
45. get_disjoint_mut — Multiple Mutable References at OnceMar 27
44. split_once — Split a String Exactly OnceMar 25
43. Vec::extract_if — Remove Elements and Keep ThemMar 25
42. array::from_fn — Build Arrays from a FunctionMar 24
40. Scoped Threads — Borrow Across Threads Without ArcMar 24
41. Async Closures — Pass Async Code Like Any Other ClosureMar 23
39. Trait Upcasting — Cast dyn Trait to dyn SupertraitMar 23
38. #[must_use] — Never Ignore What MattersMar 22
36. Cow<str> — Clone on WriteMar 22
37. Option::zipMar 21
35. LazyLockMar 21
33. std::mem::takeMar 21
34. array_windowsMar 20
32. iter::successorsMar 20
31. HashMap's entry APIMar 19
30. dbg! macroMar 19
29. Let chains
2023
2022
Dec 24
24. ..=XDec 24
25. Option's iteratorDec 06
23. Enum's default valueNov 11
22. Enum's DebugOct 22
21. Zip longestSep 11
20. let-else statementsAug 18
19. breaking from labeled blocksJul 13
18. flatten optionsJun 10
16. Option/Result match?!Apr 20
14. Find index of itemApr 20
15. ScanMar 20
12. EnumerateMar 20
13. FoldMar 20
17. filter_mapMar 19
11. FuseFeb 25
10. cloned vs copiedFeb 15
9. Inspecting iteratorFeb 10
8. DrainFeb 05
7. iter() vs into_iter()Jan 30
6. non-exhaustive enumsJan 25
5. Loop breaks and labelsJan 20
4. Option -> ResultJan 15
3. Result -> OptionJan 10
2. mysterious @Jan 05
1. matches!Jan 01
0. Hello, rustbites!