Skip to main content

Search

Items tagged with: rustcatastructures


let floor = Floor::default();<br>let mut bowl = Bowl::new();<br>let mut cat = Cat::mew();<br><br>bowl.place_on(&floor);<br>cat.sit_on(&bowl);<br><br>let floor: &mut Floor = unsafe {<br>    &mut *(&floor as *const Floor as *mut Floor)<br>};<br><br>floor.lower_by(50 * CM);<br>


Levitation needs some unsafe code, but not around the cat, cats don't take fall damage.

Original post by @Kyu : https://meow.social/@Kyu/109571030568292591

#RustCataStructures #rust #RustLang #cat #CatsOfMastodon

Not all cats have the gift of levitation.
Those that do, however, do like to flaunt it.


let four_cats: Vec<(Cat, Color)> = vec![rand::random::(Cat, Color); 4];<br>let cats = [vec![rand::random::(Cat, Color); 2], four_cats.clone(), four_cats, vec![rand::random::(Cat, Color)]].into_iter().flatten().collect::<Vec<_>>();<br>


Ahhh, this one was tricky 😅

Source: https://mastodon.nl/@ErikSchouten73/109457026165486937

@ErikSchouten73

#cat #CatsOfMastodon #rust #RustLanguage #RustLang #RustCataStructures