Skip to content

Commit 8de4e09

Browse files
committed
Address clippy warnings
1 parent 386eb6d commit 8de4e09

5 files changed

Lines changed: 9 additions & 13 deletions

File tree

lib/src/bolt/structs/point.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ impl<'de> Deserialize<'de> for Point {
349349
type Value = Point;
350350

351351
fn expecting(&self, formatter: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
352-
formatter.write_str(concat!("a valid Point2D or Point3D struct"))
352+
formatter.write_str("a valid Point2D or Point3D struct")
353353
}
354354

355355
fn visit_enum<A>(self, data: A) -> Result<Self::Value, A::Error>

lib/src/connection.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ impl InitOpts {
345345
}
346346

347347
#[cfg(feature = "unstable-bolt-protocol-impl-v2")]
348-
pub(crate) fn to_hello(&self, version: Version) -> Hello {
348+
pub(crate) fn to_hello(&self, version: Version) -> Hello<'_> {
349349
match self.routing {
350350
Routing::No => HelloBuilder::new(&self.user, &self.password).build(version),
351351
Routing::Yes(ref routing) => HelloBuilder::new(&self.user, &self.password)

lib/src/messages/bye.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ use neo4rs_macros::BoltStruct;
88
feature = "unstable-bolt-protocol-impl-v2",
99
deprecated(since = "0.9.0", note = "Use `crate::bolt::Bye` instead.")
1010
)]
11+
#[allow(unused)]
1112
pub struct Bye;
1213

1314
#[cfg(test)]

lib/src/types/serde/builder.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -256,18 +256,13 @@ impl ElementBuilder {
256256
}
257257
}
258258

259-
#[derive(Debug, Copy, Clone)]
259+
#[derive(Debug, Copy, Clone, Default)]
260260
pub enum SetOnce<T> {
261+
#[default]
261262
Empty,
262263
Set(T),
263264
}
264265

265-
impl<T> Default for SetOnce<T> {
266-
fn default() -> Self {
267-
Self::Empty
268-
}
269-
}
270-
271266
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
272267
pub struct SetOnceError;
273268

lib/src/utils/concurrent_hashmap.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,19 +40,19 @@ where
4040
map.get(k).cloned()
4141
}
4242

43-
pub fn remove<Q: ?Sized>(&self, k: &Q) -> Option<V>
43+
pub fn remove<Q>(&self, k: &Q) -> Option<V>
4444
where
4545
K: Borrow<Q>,
46-
Q: Hash + Eq,
46+
Q: Hash + Eq + ?Sized,
4747
{
4848
let mut map = self.inner.write().unwrap();
4949
map.remove(k)
5050
}
5151

52-
pub fn contains_key<Q: ?Sized>(&self, k: &Q) -> bool
52+
pub fn contains_key<Q>(&self, k: &Q) -> bool
5353
where
5454
K: Borrow<Q>,
55-
Q: Hash + Eq,
55+
Q: Hash + Eq + ?Sized,
5656
{
5757
let map = self.inner.read().unwrap();
5858
map.contains_key(k)

0 commit comments

Comments
 (0)