@atamakahere@mastodon.social avatar

atamakahere

@atamakahere@mastodon.social

This profile is from a federated server and may be incomplete. Browse more on the original instance.

atamakahere, to rust
@atamakahere@mastodon.social avatar

What would be the best way to learn ?

I am reading the rust for rustaceans book, but it’s not the end of all, I need to implement my learning. What could be the best, short and crisp way to utilise most of async and concurrent feature in a small application?

My goal is to get confident enough that I can build/contribute to something like or a database like

atamakahere, to Java
@atamakahere@mastodon.social avatar

Yes, I love playing Minecraft (and hosting minecraft servers too)

Wish I knew enough to make my own mods :unarist:

Is it possible to interface mod api with ?

atamakahere, to rust
@atamakahere@mastodon.social avatar

Today I tried language, it’s pretty much syntax and ideology and also their documentation is nice.

mo8it, to rust
@mo8it@fosstodon.org avatar

performance tip 🚀

If you want to update the value of a String, it is more efficient to recycle the existing allocation with clear and write* instead of reallocating with format! ♻️

shows that the method with format! has one allocation while the other one doesn't 😃

Divan output:

atamakahere,
@atamakahere@mastodon.social avatar

@mo8it I wonder what would happen if the updated string is longer than the old one, for the above example, if you take the number 144 to be randomised u32 (0 to u32::MAX) , that would be more general use case and accurate benchmark too

atamakahere, to rust
@atamakahere@mastodon.social avatar

While implementing dependency injection in using its trait system, we rediscovered the “implied bounds” problem which was already in discussion from 2014 but not yet implemented.

https://smallcultfollowing.com/babysteps/blog/2014/07/06/implied-bounds/

https://rust-lang.github.io/rfcs/2089-implied-bounds.html

PS it’s a part of 2024 edition roadmap

danjac, to rust
@danjac@masto.ai avatar

Done some refactoring on my little project. The "?" operator for handling Result errors is particularly elegant and allowed me to untangle some nested match/if statements.

atamakahere,
@atamakahere@mastodon.social avatar

@danjac you should consider thiserror crate if you haven’t already, and .map_err() method on Results

  • All
  • Subscribed
  • Moderated
  • Favorites
  • JUstTest
  • kavyap
  • DreamBathrooms
  • mdbf
  • InstantRegret
  • ngwrru68w68
  • magazineikmin
  • thenastyranch
  • Durango
  • rosin
  • Youngstown
  • slotface
  • khanakhh
  • tacticalgear
  • megavids
  • ethstaker
  • cubers
  • cisconetworking
  • normalnudes
  • modclub
  • everett
  • osvaldo12
  • GTA5RPClips
  • Leos
  • anitta
  • tester
  • provamag3
  • lostlight
  • All magazines