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
proto: add into_parts methods #1397
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1397 +/- ##
==========================================
- Coverage 85.16% 85.16% -0.00%
==========================================
Files 153 153
Lines 15040 15036 -4
==========================================
- Hits 12808 12804 -4
Misses 2232 2232 |
@bluejekyll we had talked about this yesterday, but there is in fact a
lint that would have caught the
But it is rather subjective |
Most of those warnings look good. Do they not get enabled by default with clippy? As part of our cleanliness test in CI, we run clippy with default settings and edit: I see you added the missing_copy_impls. That's fine in this PR, it looks relatively small impact. I'll open a separate pr for the other settings, we can debate there. |
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.
Some questions/concerns to discuss around the potential programming errors on Message and RecordSet...
crates/proto/src/rr/rr_set.rs
Outdated
Name, | ||
RecordType, | ||
DNSClass, | ||
u32, |
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.
similar question to that of the Message into_parts
function.
Okay, I've updated this PR with the For the sake of consistency, I can make Also added |
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.
LGTM! Thanks!
6548b6c
to
64bd299
Compare
Sorry for all the pushes, just trying to satisfy the CI here and get a pass |
And it looks like you did. I think This is ready to merge. Do you mind if I squash it into main? |
Oh. Looks like this needs a rebase. |
Yeah go for it. Otherwise I'll rebase tomorrow.
…On Sun., Mar. 7, 2021, 10:23 p.m. Benjamin Fry, ***@***.***> wrote:
And it looks like you did. I think This is ready to merge. Do you mind if
I squash it into main?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#1397 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAITO3RMERI67SWQTFSZAATTCQ7KJANCNFSM4YNLOJYA>
.
|
Should be good to go now 🤞 |
Thanks for the PR! |
summary:
Header
isCopy
-options_mut
added toOPT
(I had wanted this before but for some reason forgot to add it)AsMut
/AsRef
added toOPT
into_parts
methods added toMessage
Record
Query
RData
-- these methods are useful for us because we want to consume aMessage
after we're done processing and transform it into a log struct, however we can only clone data currently.It occurred to me that it might be nice to have
into_ascii
that consumesself
and returns aString
as well asto_ascii
forName
andLabel
. I have not added these here as I'm not sure if it's possible yet. Any thoughts?