after-drop 1.0.1

Will act like defer in go or jai, but you can store it and move it
Documentation
  • Coverage
  • 50%
    3 out of 6 items documented0 out of 5 items with examples
  • Size
  • Source code size: 3.6 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 220.3 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 7s Average build duration of successful builds.
  • all releases: 7s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • konkitoman/after-drop
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • konkitoman

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!