Skip to content

Conversation

@TobiasvdVen
Copy link
Contributor

@TobiasvdVen TobiasvdVen commented Sep 17, 2025

These changes expand support for the class of "constructor" methods (that return Self, Box<Self>, etc.) to return a tuple containing Self. For example:

#[faux::create]
pub struct Foo;

#[faux::methods]
impl Foo {
    pub fn new() -> (Self, i32) {
        (Foo, 0)
    }
}

Let me know what you think.

Minor note: In the commit history, it can be seen that I split the macros project in two, in order to be able to invoke the macro logic from a test and debug it. I found this helpful to learn how faux worked and make my changes. I undid all of this for purpose of the PR though, as it would greatly clutter the changes.

@nrxus nrxus merged commit a23675f into nrxus:master Sep 20, 2025
@nrxus
Copy link
Owner

nrxus commented Sep 20, 2025

Thank you! I'll try to do a patch release soon with this feature

@TobiasvdVen
Copy link
Contributor Author

Awesome, thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants