-
Notifications
You must be signed in to change notification settings - Fork 126
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
Toggle pedantic on neqo common #374
Conversation
c70d6f3
to
0bee0bd
Compare
neqo-crypto/src/aead.rs
Outdated
// The directive is placed here because | ||
// we cannot stack directives. | ||
// Placing it on top of #[must_use] doesn't work. | ||
#[allow(clippy::unused_self)] |
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.
It seems like this lint did not exist for the toolchain our CI uses.
Not really sure if/when we want to bump versions, so I'll remove this directive for now.
Let's keep in mind we will have to add it again once we update our clippy/rustc versions in the CI
0bee0bd
to
6f4a280
Compare
neqo-transport/src/frame.rs
Outdated
let (fin, fill) = if data.len() > remaining { | ||
if remaining == 0 { | ||
return None; | ||
let (fin, fill) = match data.len().cmp(&remaining) { |
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 going to conflict with #370.
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.
Let's wait until #370 lands then so I can rebase :)
neqo-transport/src/recv_stream.rs
Outdated
@@ -523,7 +523,7 @@ mod tests { | |||
let flow_mgr = Rc::new(RefCell::new(FlowMgr::default())); | |||
let conn_events = ConnectionEvents::default(); | |||
|
|||
let mut s = RecvStream::new(567.into(), 1024, flow_mgr.clone(), conn_events.clone()); | |||
let mut s = RecvStream::new(567.into(), 1024, flow_mgr, conn_events); |
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.
I'm not sure that I follow this change. These are Rc<>
instances that presumably we want to clone for passing into multiple invocations of this function. Has Rc
picked up an implementation of Copy
in a recent version of rust?
I would have thought that moving to Rc::clone(&flow_mgr)
would be wise, but I don't see that here either.
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.
Oh nice catch, I'll move it to Rc::clone() to make it more explicit.
I think I got fooled by the linter, which advises to remove .clone(), which doesn't make sense in an Rc context.
It might be worth opening an issue to clippy.
Edit: just did rust-lang/rust-clippy#4982
6f4a280
to
4e17ba1
Compare
4e17ba1
to
cc36db5
Compare
Rebased against master, now that #370 has merged |
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.
Two Rc::clone()
instances and this is great. Thanks for doing all of this!
cc36db5
to
2d335d2
Compare
2d335d2
to
ca0a53e
Compare
Please let me know if you would like me to squash the commits, and if there's anything I can do to improve the PR :)