From ad96fffd4618ba6e126cc16214a04cf3902f5d99 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Fri, 18 Oct 2024 17:07:43 +0200 Subject: [PATCH 1/1] add newer version of uninit example --- personal/_posts/2019-07-14-uninit.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/personal/_posts/2019-07-14-uninit.md b/personal/_posts/2019-07-14-uninit.md index bbb1468..fdf0996 100644 --- a/personal/_posts/2019-07-14-uninit.md +++ b/personal/_posts/2019-07-14-uninit.md @@ -46,6 +46,8 @@ fn main() { {% endhighlight %} **Update (2022-11-17):** Switched to `MaybeUninit` to keep the example working in newer versions of Rust. +**Update (2024-10-18):** See [here](https://play.rust-lang.org/?version=nightly&mode=release&edition=2021&gist=57ac24deac2402a40c9e1c9e4df3a4d2) for a version that works with Rust 1.82. + `always_returns_true` is a function that, clearly, will return `true` for any possible 8-bit unsigned integer. After all, *every* possible value for `x` will be either less than 120, equal to 120, or bigger than 120. A quick loop [confirms this](https://play.rust-lang.org/?version=stable&mode=release&edition=2018&gist=65b690fa3c1691e11d4d45955358cdbe). -- 2.30.2