@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 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

#Rust 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! โ™ป๏ธ

#Divan shows that the method with format! has one allocation while the other one doesn't ๐Ÿ˜ƒ

#RustLang

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
  • โ€ข
  • provamag3
  • rosin
  • thenastyranch
  • Durango
  • DreamBathrooms
  • ngwrru68w68
  • magazineikmin
  • cisconetworking
  • Youngstown
  • mdbf
  • slotface
  • osvaldo12
  • GTA5RPClips
  • kavyap
  • megavids
  • InstantRegret
  • everett
  • cubers
  • vwfavf
  • normalnudes
  • tacticalgear
  • tester
  • ethstaker
  • khanakhh
  • modclub
  • Leos
  • anitta
  • JUstTest
  • All magazines