Rust Borrowing Bell Curve
as_deref() trait Searchable { type Iterator<'a>: Iterator<Item = &'a str>; fn search<'a>(&self) -> Self::Iterator<'a>; } let outputs: Vec<Option<String>> = inputs Vec<Option<String>> .iter().filter_map(|input| input.clone()) .map(|opt: Option<String>| opt.as_deref()).map(get_output).transpose() log_result(a.as_ref().map(|op: Option<String>| opt.as_deref())); fn process<'a, 'b: 'a, T, U: Debug, F: for<'p> FnOnce(T) -> U> as_deref() .as_ref() .as_deref() .as_deref() .as_deref() log_result(result.clone()); .clone() .clone() .clone() .clone() Box::new(t); Box<dyn Searchable> Box::new(t); Box<dyn Searchable> 34% 34% 68% 14% 85 100 115 130 145
A bell-curve meme compares three approaches to Rust programming, with code snippets scattered across the graph and increasingly complicated type and borrowing syntax. The joke is that beginners and experts may arrive at similar-looking solutions, while the middle group overcomplicates everything with traits, lifetimes, `Box<dyn Searchable>`, cloning and `as_deref()`. It is shared as a reaction to excessively elaborate Rust code or debates about the “right” abstraction.
bell curve graph / график колоколообразной кривойthree meme faces / три мемных лицаcode snippets / фрагменты кодаRust programming language / язык программирования Rustblue graph area / синяя область графикаblack code labels / чёрные подписи с кодомwhite background / белый фонglasses / очкиhoodie / худиbeard / бородаpercentage labels / процентные подписиaxis numbers / числа на осиtrait declaration / объявление трейтаgeneric types / обобщённые типыclone method / метод cloneBox pointer / указатель Box
- @profunctor_io / 10660 2025-02-05
- @ithueti / 15204 2025-02-05
- Template
- Bell Curve / IQ Distribution Meme
- Type
- image
- Size
- 800×608 · 87.8 KiB
- Mood
- саркастичный, абсурдный
- Language
- en
- Added