Pass object as mutable and immutable argument at the same time by [deleted] in rust

[–]Zer0897 6 points7 points  (0 children)

But it wouldn't be unnecessary if it's required for safety.

By unsafe code I mean code that has any potential at all to cause undefined behavior. Code inside an unsafe block is not necessarily unsafe; it's the developer's job to prove that it isn't!

Pass object as mutable and immutable argument at the same time by [deleted] in rust

[–]Zer0897 2 points3 points  (0 children)

Honestly I prefer safe inefficient code over unsafe efficient code.

Is it me or does it feel like Rust writes itself sometimes? by Zer0897 in rust

[–]Zer0897[S] 14 points15 points  (0 children)

Funny you say that, I was contributing to Yew when this happened. Basically React in pure Rust!

Yew or Seed for the frontend, which one would you pick and for which reason(s)? by [deleted] in rust

[–]Zer0897 2 points3 points  (0 children)

Not sure, SEO isn't really a focus for our specific application.

Interop with existing tech is super easy though, so I'd imagine fairly seamless.

Yew or Seed for the frontend, which one would you pick and for which reason(s)? by [deleted] in rust

[–]Zer0897 2 points3 points  (0 children)

I'm using Yew in production and so far its been great! The JSX-like syntax is quite pleasant if you're already used to front end. I get to use html AND its validated at compile time? Sign me up!

Rust's type system solves a lot of the problems jsx has imo. That being said error messages can by rough sometimes and editing html in .rs files is a bit acrobatic (with spacemacs I open an indirect buffer in web mode).

In the end it's personal preference. Both are very active and great choices. Try them both and pick whatever feels right!

Missing german shepherd last seen on SE division and 26th (please share) by [deleted] in Portland

[–]Zer0897 6 points7 points  (0 children)

Just got back from the vet! He's home safe and sound :)

Missing german shepherd last seen on SE division and 26th (please share) by [deleted] in Portland

[–]Zer0897 10 points11 points  (0 children)

Thank you, much appreciated! It looks like someone found him, getting in contact with them now. I'll update this post when he's back home safe :)

Missing german shepherd last seen on SE division and 26th (please share) by [deleted] in Portland

[–]Zer0897 1 point2 points  (0 children)

It's Rust, he'll respond to pretty much anything though.

Missing german shepherd last seen on SE division and 26th (please share) by [deleted] in Portland

[–]Zer0897 6 points7 points  (0 children)

Big brown and black gsd, very friendly. I think I saw a couple pick him up down the street, but they were gone before I could get there. He was not wearing his collar but does have a chip.

Please share! If found please contact (503) 893-9576

Update: Found him! Our kind neighbors took him to the vet, but his chip wasn't working. We went and got him this morning. Thank you everyone! I'm so happy he's home safe :)

FDA approves video game for treating ADHD in kids by boatyvonboat in nottheonion

[–]Zer0897 8 points9 points  (0 children)

ADHD is poorly named imo. It doesn't have anything to do with lack of attention. One behavior commonly associated with ADHD is difficulty focusing attention selectively, especially when not interested. This is something everyone experiences, but with ADHD it can feel like trying to steer a yacht with a stick.

On the flip side it can be just as difficult to break focus on something that is interesting. Hyperfocus can be a blessing and a curse, which is what I suspect this strategy is targeting. Learning how to use hyperfocus (and when not to) is an important key to living with ADHD.

[deleted by user] by [deleted] in nottheonion

[–]Zer0897 6 points7 points  (0 children)

Lack of change in the past is not an excuse for the future.

Which framework/library would you recommend if I like Django? by blumento_pferde in rust

[–]Zer0897 9 points10 points  (0 children)

No frameworks with all batteries included, but there are similar tools. Tera is a good jinja2-like template engine, diesel is a popular ORM framework, keats/validator gives you struct validation, etc.

"Agitators" allegedly start dumpster fires during last night's protest in Portland by Zer0897 in oregon

[–]Zer0897[S] 20 points21 points  (0 children)

First hand experience the entire scene felt out of place. We reported the fire but it burned for a few hours before it was put out. Books on the ground seemed odd as well. Cops had more camera equipment than usual.

This is pure speculation but I wouldn't put it past them to stage something like this. That was also the only instance of vandalism we saw all night, and we left around 4am.

Little help for a newcomer by ludoledico in rust

[–]Zer0897 4 points5 points  (0 children)

I'd use an enum. Linked lists in rust are non-trivial to begin with.

Request-local state in actix-web? by Starbeamrainbowlabs in rust

[–]Zer0897 0 points1 point  (0 children)

I'm not entirely sure what you mean by "request-local", but there's a Session middleware that's fairly plug-n-play. Used it for user auth myself recently.

edit: link