How is it a code smell? I'm pretty sure interior mutability is a well established design pattern. I'm not really familiar with the pattern you're describing using Ref/RefMut wrapping, could you show me what you mean?

Yeah I didn't want to pour a bunch of time into wrangling borrow checker stuff for a small code snippet.

[-] ExperimentalGuy@programming.dev 2 points 1 month ago* (last edited 1 month ago)

Finally got around to writing the code, here's the link to the Rust playground with it. I was too lazy to do the unsafe stuff, but where I call clone in the deny and accept functions are where you'd rewrite and do unsafe magic to swap out elements without the clone overhead.

I also tried to implement a take function (like in Option) for the Allowable enum. Transferring ownership like with take would keep you in safe land and get what you want done.

Keep in mind I am not a game dev. I don't do cache optimizations. I have no idea how this code would function in a game context, but this is just my first idea for implementation of what you asked.

[-] ExperimentalGuy@programming.dev 2 points 6 months ago

I get wanting to just do it yourself. That's part of why I asked the question because I want to be able to design my own algorithmic art pieces.

[-] ExperimentalGuy@programming.dev 2 points 6 months ago

As a vim user, I agree that it can only be improved.

[-] ExperimentalGuy@programming.dev 2 points 7 months ago

Why the fuck is there a pencil in the bottom shelf when its not listed in the lost items.

[-] ExperimentalGuy@programming.dev 2 points 7 months ago

How did you know I did that last week?

[-] ExperimentalGuy@programming.dev 2 points 8 months ago

I actually love these

Interesting. It would probably also depend on the number of other people downvoting and commenting. Also this assumes that someone consistently downvotes and comments on one post.

I love the profile picture.

I initially just used it on personal projects just so I could rollback if I needed to. Afterwards I realized that you could branch after watching Fireship videos. I never got an aha moment, but the moment I really understood was after my first pull request to a project I liked at the time.

Oftentimes someone who does the same thing over again expecting a different outcome is called insane, except in this circumstance. Sometimes a simple reboot will fix, somestimes configuration will work, but for some weird reason every fix I've tried has increased the chance that a game works rather than actually fixing the problem 100%. Do I know why? No. Am I going to figure it out? No, I'm too lazy.

I honestly didn't know this and I'd consider myself pretty technical, just not very familiar with serving ads. This is really cool, how'd u learn this?

view more: ‹ prev next ›

ExperimentalGuy

0 post score
0 comment score
joined 3 years ago