catfishing

Crates.iocatfishing
lib.rscatfishing
version0.0.1
created_at2025-05-06 21:07:44.622619+00
updated_at2025-05-06 21:07:44.622619+00
descriptionSteal fields of another struct
homepage
repositoryhttps://github.com/tkr-sh/catfishing
max_upload_size
id1662989
size25,702
tk (tkr-sh)

documentation

README

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");
}
Commit count: 8

cargo fmt