catfishing 0.0.1

Steal fields of another struct
Documentation
  • Coverage
  • 0%
    0 out of 2 items documented0 out of 1 items with examples
  • Size
  • Source code size: 25.23 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 270.9 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
  • tkr-sh/catfishing
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • tkr-sh

catfishing

#[catfishing(Robot)]
struct Human {
    age: usize,
    name: &'static str,
}

struct Robot(Human);

fn main() {
    let human = Human { age: 42, name: "John" };
    let robot = Robot(human);
    assert_eq!(robot.age(), 42);
    assert_eq!(robot.name(), "John");
}