Skip to content
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

Minor: Resolved this warning associated with a "Non-Standard" default #510

Merged
merged 1 commit into from
Oct 17, 2023

Conversation

martinfrances107
Copy link
Contributor

When I looked at the warning, I noted that everything could be auto derived.

warning: method `default` can be confused for the standard trait method `std::default::Default::default`
   --> plotters-backend/src/text.rs:120:9
    |
120 | /         pub fn default() -> Self {
121 | |             Pos {
122 | |                 h_pos: HPos::Left,
123 | |                 v_pos: VPos::Top,
124 | |             }
125 | |         }
    | |_________^
    |
    = help: consider implementing the trait `std::default::Default` or choosing a less ambiguous method name
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#should_implement_trait
    = note: `#[warn(clippy::should_implement_trait)]` on by default

…() method.

When I looked at the warning, I noted that everything could be auto derived.

```
warning: method `default` can be confused for the standard trait method `std::default::Default::default`
   --> plotters-backend/src/text.rs:120:9
    |
120 | /         pub fn default() -> Self {
121 | |             Pos {
122 | |                 h_pos: HPos::Left,
123 | |                 v_pos: VPos::Top,
124 | |             }
125 | |         }
    | |_________^
    |
    = help: consider implementing the trait `std::default::Default` or choosing a less ambiguous method name
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#should_implement_trait
    = note: `#[warn(clippy::should_implement_trait)]` on by default
```
Copy link
Member

@AaronErhardt AaronErhardt left a comment

Choose a reason for hiding this comment

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

Thanks!

@AaronErhardt AaronErhardt merged commit 81d7ea7 into plotters-rs:master Oct 17, 2023
18 checks passed
@martinfrances107 martinfrances107 deleted the default_fixup branch October 17, 2023 16:16
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