Conversation
ae6aee5 to
938ef8d
Compare
c2718c4 to
d0bce5a
Compare
src/platform_impl/ios/window.rs
Outdated
| // event on window creation if the DPI factor != 1.0 | ||
| let scale_factor: CGFloat = msg_send![view, contentScaleFactor]; | ||
| let scale_factor: f64 = scale_factor.into(); | ||
| let scale_factor: f64 = scale_factor as _; |
There was a problem hiding this comment.
The variable type was removed in a similar expression higher up.
There was a problem hiding this comment.
I don't understand what do you want from me here. The problem is that CGFLoat is either f32 or f64, but winit API is f64, so we need to cast it to f64 here. Using .into() won't work, since clippy finds it as redundant when CGFloat is f64, however we can cast it like as _ and explicitly state that we assign to f64 value.
There was a problem hiding this comment.
I think because this change was made in view.rs:
- let scale_factor: f64 = scale_factor.into();
+ let scale_factor = scale_factor as f64;Isn't that affected in the same way?
| // This is the case for xmonad and dwm, AKA the only WMs tested that supplied a | ||
| // border value. This is convenient, since we can use it to get an accurate frame. | ||
| let frame_extents = FrameExtents::from_border(border.into()); | ||
| let frame_extents = FrameExtents::from_border(border as c_ulong); |
There was a problem hiding this comment.
Which clippy gets triggered here ?
PS: the best is to do one commit per clippy type...
There was a problem hiding this comment.
we call into() to convert from u64 to u64. The problem is that the code was correct, it just bitness dependent, so it's a clippy warning on 64-bit, but works fine on 32-bit.
There was a problem hiding this comment.
PS: the best is to do one commit per clippy type...
That's very hard and wasteful if you're tackling them all at once using clippy --fix, unless collecting all the individual warnings and running clippy --fix one by one, allowing all the lints except one.
|
@MarijnS95 Do you happen to know why android target randomly fails from time to time? I think I've seen it a bunch of times here, rerunning do fix the issues. |
madsmtm
left a comment
There was a problem hiding this comment.
iOS and macOS changes looks fine (I never did like the let () = msg_send![...], so cool that Clippy doesn't either).
| #![deny(rust_2018_idioms)] | ||
| #![deny(rustdoc::broken_intra_doc_links)] | ||
| #![deny(clippy::all)] | ||
| #![cfg_attr(feature = "cargo-clippy", deny(warnings))] |
There was a problem hiding this comment.
clippy enables the cargo-clippy feature on all crates when running through it, automatically denying all rustc warnings in this instance. However, this implies warnings from clippy::all (that lint group should only include warn/deny lints) and the #![deny(clippy::all)] is thus superfluous.
There was a problem hiding this comment.
deny clippy all means that it'll error on clippy warnings instead of treating them as warnings.
There was a problem hiding this comment.
But that's also what #![cfg_attr(feature = "cargo-clippy", deny(warnings))] does :)
There was a problem hiding this comment.
I think those about rustc warnings, and not clippy onces? I think it was like that in the past, at least.
There was a problem hiding this comment.
I tested it and it includes all warnings, including clippy ones.
|
|
||
| /// Fullscreen modes. | ||
| #[derive(Clone, Debug, PartialEq)] | ||
| #[derive(Clone, Debug, PartialEq, Eq)] |
There was a problem hiding this comment.
I don't think internal impl requires it? Also I'm not sure that we should add changelog notes for Eq impls, since they are not breaking the code and transparent.
There was a problem hiding this comment.
Internal impls don't matter.
It's not a breaking change, but in general I think all API changes should be documented in the changelog, including small ones like this. But I don't have a strong opinion on this, you're free to disagree.
There was a problem hiding this comment.
A changelog entry would indeed be nice.
.github/workflows/ci.yml
Outdated
| - name: Lint with clippy | ||
| shell: bash | ||
| if: (matrix.rust_version != 'nightly') && !contains(matrix.platform.options, '--no-default-features') | ||
| run: cargo clippy --all-targets --target ${{ matrix.platform.target }} $OPTIONS --features $FEATURES |
There was a problem hiding this comment.
As said in the glutin PR, I'd like to keep -- -Dwarnings in here so that new crates and bin (example/test/bench) targets are included too.
There was a problem hiding this comment.
I think we don't want to run clippy for examples actually.
There was a problem hiding this comment.
I think we should be consistent and enforce it everywhere, so that the examples are also clean-enough.
There was a problem hiding this comment.
In addition there's --all-targets here and you fixed+allowed clippy lints in the examples/, so this is only sensible?
There was a problem hiding this comment.
I'd add -D warnings on CI then, I guess.
Having deny in lib.rs is still easier to understand that you must fix those issues.
There was a problem hiding this comment.
Yeah, leave the deny in lib.rs, that should hopefully decrease the amount of noise in PRs that would otherwise require lots of cleanup pushes to "make the CI happy".
There was a problem hiding this comment.
I'm fairly certain that the general advice here is to not deny warnings in *.rs files, and instead only do it in CI, as it might break compilation with future versions of rustc and/or clippy.
There was a problem hiding this comment.
That's the point, we don't deny warnings for rustc or any related command, just when running clippy. So there's no way the build will break, only clippy could, but it would only mean that CI is broken.
src/platform_impl/ios/window.rs
Outdated
| // event on window creation if the DPI factor != 1.0 | ||
| let scale_factor: CGFloat = msg_send![view, contentScaleFactor]; | ||
| let scale_factor: f64 = scale_factor.into(); | ||
| let scale_factor: f64 = scale_factor as _; |
There was a problem hiding this comment.
I think because this change was made in view.rs:
- let scale_factor: f64 = scale_factor.into();
+ let scale_factor = scale_factor as f64;Isn't that affected in the same way?
| // This is the case for xmonad and dwm, AKA the only WMs tested that supplied a | ||
| // border value. This is convenient, since we can use it to get an accurate frame. | ||
| let frame_extents = FrameExtents::from_border(border.into()); | ||
| let frame_extents = FrameExtents::from_border(border as c_ulong); |
There was a problem hiding this comment.
PS: the best is to do one commit per clippy type...
That's very hard and wasteful if you're tackling them all at once using clippy --fix, unless collecting all the individual warnings and running clippy --fix one by one, allowing all the lints except one.
MarijnS95
left a comment
There was a problem hiding this comment.
It looks like all my comments were addressed minus some minor nits which we can continue to discuss, nice job!
maroider
left a comment
There was a problem hiding this comment.
I don't have any further blocking concerns, although it would be nice to have changelog entries for all the added trait impls on public types.
|
Android failures were unrelated and quite random recently. |
| @@ -1,4 +1,5 @@ | |||
| #![cfg(target_os = "macos")] | |||
| #![allow(clippy::let_unit_value)] | |||
There was a problem hiding this comment.
That we have to specify this is actually a regression, I've filed an issue about it here: rust-lang/rust-clippy#8998.
Fixes #1402.