Skip to content

Commit

Permalink
Tweak doc comments
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelsproul authored Dec 5, 2024
1 parent b622c74 commit f4419f5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 1 addition & 3 deletions src/fixed_vector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,9 @@ pub struct FixedVector<T, N> {
_phantom: PhantomData<N>,
}

// Implement comparison functions even if T doesn't implement them (since we don't sotre T)
// Implement comparison functions even if N doesn't implement PartialEq
impl<T: PartialEq, N> PartialEq for FixedVector<T, N> {
fn eq(&self, other: &Self) -> bool {
// T and N are already compared because other must have the same T/N
// We don't store values of T or N, so we don't have to compare them either.
self.vec == other.vec
}
}
Expand Down
4 changes: 1 addition & 3 deletions src/variable_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,9 @@ pub struct VariableList<T, N> {
_phantom: PhantomData<N>,
}

// Implement comparison functions even if T doesn't implement them (since we don't sotre T)
// Implement comparison functions even if N doesn't implement PartialEq
impl<T: PartialEq, N> PartialEq for VariableList<T, N> {
fn eq(&self, other: &Self) -> bool {
// T and N are already compared because other must have the same T/N
// We don't store values of T or N, so we don't have to compare them either.
self.vec == other.vec
}
}
Expand Down

0 comments on commit f4419f5

Please sign in to comment.