after-drop

Crates.ioafter-drop
lib.rsafter-drop
version1.0.1
sourcesrc
created_at2023-08-25 05:36:29.973733
updated_at2023-12-09 09:05:55.660078
descriptionWill act like defer in go or jai, but you can store it and move it
homepage
repositoryhttps://github.com/konkitoman/after-drop
max_upload_size
id954336
size3,590
Konkitoman (konkitoman)

documentation

README

AfterDrop

AfterDropBoxed is normaly used to store it in a struct, Can be used for other crates to do something when a thing is droped!

Inspiration

  • jai with defer keyword
  • go with defer keyword

Why

This is usefull for example if you want to do someting at the end of the function! If you have a lot of branches in function, with more returns will be really difficult to do this, not really but you will need to call that function every time return! But when using ? rust operator that will return without you knowing, this is really usefull!

Commit count: 3

cargo fmt