Skip Navigation

InitialsDiceBearhttps://github.com/dicebear/dicebearhttps://creativecommons.org/publicdomain/zero/1.0/„Initials” (https://github.com/dicebear/dicebear) by „DiceBear”, licensed under „CC0 1.0” (https://creativecommons.org/publicdomain/zero/1.0/)E
Posts
9
Comments
154
Joined
3 yr. ago

DM for SimpleX

  • What's your goal with switching languages? You need to figure out what business requirements are fulfilled more effectively given that technical change before making that change. I mostly say this because I don't hear a clear reason for the switch in your post.

    For the rust ecosystem in general, reading through the cargo help output to see what tooling is there is a great start. You can see what functionality is already baked into the native language tooling, which should guide you on the right path. Off the top of my head, theres ways to test and lint your code already built in. Best practices are usually crate dependent, especially when working with something (I think) is macro heavy like dioxus(I don't do a lot of UI in rust). Make sure to go through the provided dioxus code examples because those will probably cover most use cases you'll be going for.

  • If you were a secretary, you could probably have some spare time during work hours to do what you like too!

  • Yeah what I wrote was just something to get the idea out, about having a list of Allowables.

    I just fully read your code, and I like how you changed the Allowable api to have a deny and allow function instead of it being at the AllowList level. Honestly, I did not know mem::take was a function. I like how you got around cloning too.

    Also, just so you know, you come off pretty rude. Just want to make sure you know that if you're not aware.

  • Also sorry, I realized I worded my response a little rude earlier. Didn't mean it like that, I was just speaking matter of factly!

  • 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.

  • 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.

  • I don't think you need a mutex for this situation.

  • What are the conditions for T to be accessed? You could potentially wrap each instance of T in an enum that has two states, Allow and Deny, where if you encounter a Deny you just don't access that one. If you have a slice of this enum where each enum owns T, you can always just swap out a Deny for an Allow or vice versa depending on how you want to do it. If you go this route, you might want to make a struct that owns the vector mutably, can return an immutable borrow to the slice, and change permissions on the slice. Now that I'm thinking about it, you can also implement a gets function on the struct that would return a Result

    <T>

    depending on whether it was an allow or a deny. I don't think you'd need unsafe with this.

    The solution mostly depends on the context surrounding how you're managing what can access T and at what time. I can see the solution I proposed not working if you need more specific permissions than allow or deny, or if the permissions are based on the caller.

    Edit: I'm going to come back in a few hours and write code about what I mean in the first paragraph.

  • Good bot

  • I always support the underdog. Jarred sounds like an ass.

  • That rhymes

  • What the fuck is that url

  • Reading up on Linux filesystem structure or reading manpages has done wonders for how I understand Linux. Also, keeping up with big security vulnerabilities usually helps because they talk about internals or parts of Linux that you may have never heard of or it's in a unique way that you haven't heard of before.

    I don't do crazy stuff on Linux, but I know the basics. If you ever have a question, feel free to reach out if you'd like!

  • Deleted

    Permanently Deleted

    Jump
  • Who the fuck downvoted this

  • How do you learn to social dance?

  • Wicked dude

  • I think it means they have an egg under their ass

  • They also have a pgp fork😭

  • This blog posts makes some weird assumptions. One that especially stood out to me was that when writing a password, someone would only capitalize the first letter. What? Its probably more common, but its definitely not the only letter someone would capitalize. There's a few other assumptions like that, and I'm not sure where they're coming from.

  • Programming @programming.dev

    How have you made art with code?

  • News @lemmy.world

    Nestlé dismisses CEO due to an inappropriate relationship with a subordinate

    apnews.com /article/nestle-ceo-inappropriate-relationship-c80cca44e9b4c76c9ed10aab00400bef
  • Rust @programming.dev

    How do you implement API Keys?

  • Rust @programming.dev

    How would you recommend rate limiting your own program?

  • Rust @programming.dev

    Do you know how to use Feedbacks in LibAFL?

    docs.rs /libafl/latest/libafl/feedbacks/index.html
  • Programming @programming.dev

    Making malware

  • Programming @programming.dev

    Good Computer Handbooks

  • Linux @programming.dev

    Linux Server OSes?

  • Rust @programming.dev

    Runtime Profiling in Rust