mutification_derive 0.3.0

Convert immutable reference to mutable reference.
Documentation
  • Coverage
  • 0%
    0 out of 2 items documented0 out of 1 items with examples
  • Size
  • Source code size: 3.57 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 277.59 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 5s Average build duration of successful builds.
  • all releases: 5s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Bruce0203/mutification
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • Bruce0203

mutification

Convert immutable reference to mutable reference. When creating a getter and setter as a trait to get a field from a structure in a complex gaming system, this is a crate that safely changes an immutable reference to a mutable reference so that you can bypass the Rust compiler rules where you can't borrow another field at the same time!

  • to_mut crate is more conventient than to-mut/to-mut-proc-macro.
  • Support generics.

example

fn test_to_mut(player: &Player) {
    player.to_mut().name = "Bruce";
}