Skip to content

Apply Clippy fixes#27

Open
JDeeth wants to merge 2 commits intomkreu:masterfrom
JDeeth:apply-clippy-fixes
Open

Apply Clippy fixes#27
JDeeth wants to merge 2 commits intomkreu:masterfrom
JDeeth:apply-clippy-fixes

Conversation

@JDeeth
Copy link
Contributor

@JDeeth JDeeth commented Apr 29, 2025

There are 30 Clippy warnings, 21 of which can be automatically fixed. This PR suppresses three of them and resolves the others.

JDeeth added 2 commits April 29, 2025 22:53
via the command `cargo clippy --fix --lib -p xplm`
These should not be breaking changes.

There are a couple of warnings I was not certain about, which I've
suppressed and marked TODO instead.
Comment on lines +102 to 104
// TODO: examine if this warning is applicable and this should be `to_xplm(self)`
#[allow(clippy::wrong_self_convention)]
fn to_xplm(&self) -> xplm_sys::XPLMDrawingPhase {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably this should be renamed to as_xplm

Comment on lines 97 to +98
/// Each item is in a Box, to allow callbacks to reference it.
children: RefCell<Vec<Box<Item>>>,
children: RefCell<Vec<Item>>,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment above this line indicates that there was a reason for this additional boxing, although I do not entirely get what this comment wants to tell me...

Comment on lines +93 to 95
// TODO: determine if Clippy warning about `new` not returning `self` is applicable
#[allow(clippy::new_ret_no_self)]
pub fn new<R: Into<Rect<i32>>, D: WindowDelegate>(geometry: R, delegate: D) -> WindowRef {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should probably rename this function to create(...) or sth. similar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants