nerdblood

joined 2 years ago
[–] nerdblood@programming.dev 4 points 2 years ago (1 children)

Oh man, I didn't know debug_handler existed. Sure enough I had a missing derived attribute... not sure how but Serde serialize and deserialize were missing, so when I was trying to return Ok(Json(army)) it was failing. Thanks so much!

[–] nerdblood@programming.dev 1 points 2 years ago

Thanks for the reply! I don't know what you mean by extensions, but the state is literally just the DB connection:

struct AppState { conn: DatabaseConnection, }

[–] nerdblood@programming.dev 1 points 2 years ago

Async I have a handle on, but I'll take a look at the others for sure.

[–] nerdblood@programming.dev 1 points 2 years ago

Nice, thanks... looking into these now.

[–] nerdblood@programming.dev 1 points 2 years ago (1 children)

🤔 I thought lazy_static was deprecated in favor of one_cell

[–] nerdblood@programming.dev 1 points 2 years ago (2 children)

One for now, theoretically many later.

Nice I've never used Rc. Maybe now's my chance to look into it.

[–] nerdblood@programming.dev 2 points 2 years ago

🤯 that's how it should be. I'm sick of shenanigans.

[–] nerdblood@programming.dev 1 points 2 years ago (2 children)

I haven't tried it with Deno. Is it less of a pain to get started with project s that use TS than node?

[–] nerdblood@programming.dev 4 points 2 years ago

Also, move out special types to types.rs, error types to errors.rs to keep the area with the actual algorithms more clear.

Ok this is totally something my code base needs. Very actionable feedback.

And yeah that's one of the things I love about rust; it will tell me everywhere things are out of wack. It's such a different experience from back when I had large JavaScript code bases. Make changes and pray lol.

[–] nerdblood@programming.dev 3 points 2 years ago

This is really good to hear, I don't think I'm as far off base as I thought; maybe I've been over thinking it a bit. And thanks for that refactoring resource. I'm very big into making my TS code clean and maintainable. I'm just thrown off a bit with the new paradigm.

[–] nerdblood@programming.dev 1 points 2 years ago

Oh wow, default is so nice. I wasn't exactly looking for this when I asked the question, but I'm glad you tipped me off to it.

[–] nerdblood@programming.dev 1 points 2 years ago

Default could be useful here, thanks!

view more: ‹ prev next ›