-
-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
write!
macro
#263
write!
macro
#263
Conversation
3ec4a49
to
f8ed94b
Compare
f8ed94b
to
696bdc5
Compare
This now implements a more limited, but backwards-compatible version where you can only call |
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.
this is excellent work.
before publishing defmt 0.1.2 we should mention this feature in the book but that can be done in a follow-up PR so I'll hit the merge button now
@@ -750,44 +750,6 @@ pub fn debug_assert_ne_(ts: TokenStream) -> TokenStream { | |||
.into() | |||
} | |||
|
|||
// TODO share more code with `log` | |||
#[proc_macro] | |||
pub fn winfo(ts: TokenStream) -> TokenStream { |
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.
🎉
} | ||
|
||
defmt::info!( | ||
"nested `Format` impls using `write!`: {:?}", |
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.
💯 (this is a test case I was going to suggest)
impl Format for MyStruct { | ||
fn format(&self, fmt: &mut defmt::Formatter) { | ||
defmt::write!(fmt, "one"); | ||
defmt::write!(fmt, "two"); |
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.
👍
Closes #104
Closes #97 (
winfo!
is removed)