-
-
Notifications
You must be signed in to change notification settings - Fork 62
Conversation
You might also want to add another branch to the macro after the Did you test that all the other parts are working? The syntax looks fine to me in any case. Maybe we can add some tests for this (and fix the existing tests)? :) |
|
Oh you meant the examples maybe? Well, the PR is already open, just not up to date. |
I also added a check for the keyword (better than having a macro error. :) ) |
…field accesses And simplify error handling of self variable names.
@GuillaumeGomez Improved the error handling a bit and also fixed a bug. This should be good to go I guess :) |
let $variable = $variable.clone(); | ||
); | ||
(@weak $variable:ident) => ( | ||
let $variable = $crate::clone::Downgrade::downgrade(&$variable); | ||
); | ||
(@ $keyword:ident $variable:ident) => ( | ||
compile_error!("Unknown keyword, only `weak` and `strong` are allowed"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The stringify!(keyword)
wasn't working?
The `stringify!(keyword)` wasn't working?
It was but compile_error! does not allow formatting currently, it requires a single string.
Maybe you can get around that with concat! etc, give it a try :)
…--
Sent from my Android device with K-9 Mail. Please excuse my brevity.
|
Na, not worth it. Looks good to me now. Once merged, I'll update my examples PR. |
Merged, please fix the examples then :) Thanks! |
Will do before the end of the day! |
Fixes #532.
Fixes #533.
cc @sdroege @EPashkin @antoyo