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

Fix some clippy lints #443

Merged
merged 8 commits into from
Jan 27, 2024
Merged

Fix some clippy lints #443

merged 8 commits into from
Jan 27, 2024

Commits on Jan 27, 2024

  1. Add #[allow(clippy::eq_op)] for unit! macro.

    Without this, `clippy` would give a lot of errors, because of the
    `prefix!(kilo) / prefix!(kilo)` and other similar macro calls which have
    result in 1 which is okay for our use case. Therefore the
    `#[allow(...)]` seems reasonable here.
    hellow554 authored and iliekturtles committed Jan 27, 2024
    Configuration menu
    Copy the full SHA
    8cdabec View commit details
    Browse the repository at this point in the history
  2. Implement clone properly for copy types.

    This fixes another `clippy` warning:
    
    ```
    warning: non-canonical implementation of `clone` on a `Copy` type
        --> src/system.rs:1468:41
         |
    1468 |                   fn clone(&self) -> Self {
         |  _________________________________________^
    1469 | |                     Self {
    1470 | |                         dimension: $crate::lib::marker::PhantomData,
    1471 | |                         unit: self.unit.clone(),
    1472 | |                         style: self.style.clone(),
    1473 | |                     }
    1474 | |                 }
         | |_________________^ help: change this to: `{ *self }`
    ```
    hellow554 authored and iliekturtles committed Jan 27, 2024
    Configuration menu
    Copy the full SHA
    37ce1e8 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    fef20c2 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    dd89552 View commit details
    Browse the repository at this point in the history
  5. Use more Self.

    hellow554 authored and iliekturtles committed Jan 27, 2024
    Configuration menu
    Copy the full SHA
    e06a5e8 View commit details
    Browse the repository at this point in the history
  6. Make description a const fn.

    hellow554 authored and iliekturtles committed Jan 27, 2024
    Configuration menu
    Copy the full SHA
    499b3c3 View commit details
    Browse the repository at this point in the history
  7. Use digit separator.

    hellow554 authored and iliekturtles committed Jan 27, 2024
    Configuration menu
    Copy the full SHA
    0933755 View commit details
    Browse the repository at this point in the history
  8. Make unit a unused phantom data in fmt::Arguments.

    The value of that type is never use, only the actual type parameter `N`
    hellow554 authored and iliekturtles committed Jan 27, 2024
    Configuration menu
    Copy the full SHA
    35e0cfa View commit details
    Browse the repository at this point in the history