Skip to content

Commit

Permalink
clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
turboladen committed Aug 28, 2024
1 parent 3edf401 commit 5ca6ff8
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
1 change: 0 additions & 1 deletion crates/api/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
implementation of `PartialEq` does not do this).
- `Composition` now derives `Ord`.
- `Unit::simplify()`, extracted from the (redesigned) innards of `Unit::expression_reduced()`.
- `Term` now derives `Hash`.

### Changed

Expand Down
2 changes: 2 additions & 0 deletions crates/api/src/measurement/ops/add_sub.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ use crate::{convertible::Convertible, error::Error, measurement::Measurement};
feature = "cffi",
ffi_common::derive::expose_fn(extend_type(Measurement))
)]
#[allow(clippy::result_large_err)]
fn add_measurements(lhs: &Measurement, rhs: &Measurement) -> Result<Measurement, Error> {
let rhs_converted = rhs.convert_to(&lhs.unit)?;
let new_value = lhs.value + rhs_converted.value;
Expand Down Expand Up @@ -65,6 +66,7 @@ impl<'a> Add<Measurement> for &'a Measurement {
feature = "cffi",
ffi_common::derive::expose_fn(extend_type(Measurement))
)]
#[allow(clippy::result_large_err)]
fn sub_measurements(lhs: &Measurement, rhs: &Measurement) -> Result<Measurement, Error> {
let rhs_converted = rhs.convert_to(&lhs.unit)?;
let new_value = lhs.value - rhs_converted.value;
Expand Down
2 changes: 1 addition & 1 deletion crates/api/src/term.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ impl From<Atom> for Term {
/// `1+2{foo}`; raised to the -2nd power becomes `1-2{foo}`. Notice that a factor, exponent and
/// annotation are all required to represent that.
///
#[derive(Clone, Debug, Eq, Hash)]
#[derive(Clone, Debug, Eq)]
pub enum Term {
/// Ex. "{tree}", where the inner `String` would be the contents inside the curly braces.
///
Expand Down
8 changes: 4 additions & 4 deletions crates/api/src/term/ucum_unit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@ impl UcumUnit for super::Term {
/// The UCUM defines "arbitrary units" using three points. First:
///
/// > units whose meaning entirely depends on the measurement procedure
/// (assay). These units > have no general meaning in relation with any
/// other unit in the SI.
/// > (assay). These units > have no general meaning in relation with any
/// > other unit in the SI.
///
/// Second:
///
/// > An arbitrary unit has no further definition in the semantic framework
/// of The Unified Code > for Units of Measure.
/// > of The Unified Code > for Units of Measure.
///
/// Third:
///
/// > Arbitrary units are not “of any specific dimension” and are not
/// “commensurable with” any > other unit.
/// > “commensurable with” any > other unit.
///
fn is_arbitrary(&self) -> bool {
self.atom()
Expand Down
2 changes: 1 addition & 1 deletion crates/api/src/v2/convert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pub trait ToFraction<N = Option<Self>, D = Option<Self>, F = (N, D)> {
///
/// The differences with this trait compared to `Convertible<RHS>` are:
/// 1. it doesn't require the output to be a `Result` like the original does. This allows for
/// implementing for types that can guarantee a conversion.
/// implementing for types that can guarantee a conversion.
/// 2. it can be implemented for multiple output types.
///
#[allow(clippy::module_name_repetitions)]
Expand Down

0 comments on commit 5ca6ff8

Please sign in to comment.