Skip to content

Commit 4bd0896

Browse files
committed
clippy
1 parent 63074af commit 4bd0896

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
members = ["client", "server", "common", "async_file_cache", "ruma-headers"]
33
resolver = "2"
44

5-
5+
[workspace.lints.clippy]
6+
clone-on-ref-ptr = "warn"
67

78
[profile.dev.package."*"]
89
# Set the default for dependencies in Development mode.

common/src/parsing.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use thiserror::Error;
22

33
type Str = Box<str>;
44

5-
#[derive(Debug, Eq, PartialOrd, Ord, Hash, Clone)]
5+
#[derive(Debug, Eq, PartialOrd, Ord, Clone)]
66
pub struct Package {
77
name: Str,
88
version: Str,
@@ -37,6 +37,14 @@ impl PartialEq for Package {
3737
}
3838
}
3939

40+
impl std::hash::Hash for Package {
41+
fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
42+
self.name.hash(state);
43+
self.version.hash(state);
44+
self.arch.hash(state);
45+
}
46+
}
47+
4048
#[derive(Error, Debug)]
4149
pub enum PackageParseError {
4250
#[error("{0:?}")]

lints.clippy

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

0 commit comments

Comments
 (0)