diff --git a/lib/Cargo.toml b/lib/Cargo.toml index 620ff49..2f2f321 100644 --- a/lib/Cargo.toml +++ b/lib/Cargo.toml @@ -7,7 +7,7 @@ license = "MIT" keywords = ["neo4j", "cypher", "dto", "query", "graph"] categories = ["database"] repository = "https://github.com/jifalops/cypher-dto" -metadata.msrv = "1.60" +metadata = { msrv = "1.60" } [features] default = ["macros"] diff --git a/lib/src/entity.rs b/lib/src/entity.rs index 0252eb7..9a95ac5 100644 --- a/lib/src/entity.rs +++ b/lib/src/entity.rs @@ -127,11 +127,11 @@ pub(crate) mod tests { Ok(Self { name: value .get("name") - .map_err(|e| Error::MissingField("name".to_owned()))?, + .map_err(|_e| Error::MissingField("name".to_owned()))?, age: u8::try_from( value .get::("age") - .map_err(|e| Error::MissingField("age".to_owned()))?, + .map_err(|_e| Error::MissingField("age".to_owned()))?, ) .map_err(|_| Error::TypeMismatch("age".to_owned()))?, }) @@ -535,79 +535,79 @@ pub(crate) mod tests { usize_num: usize::try_from( value .get::("usize_num") - .map_err(|e| Error::MissingField("usize_num".to_owned()))?, + .map_err(|_e| Error::MissingField("usize_num".to_owned()))?, ) .map_err(|_| Error::TypeMismatch("usize_num".to_owned()))?, isize_num: isize::try_from( value .get::("isize_num") - .map_err(|e| Error::MissingField("isize_num".to_owned()))?, + .map_err(|_e| Error::MissingField("isize_num".to_owned()))?, ) .map_err(|_| Error::TypeMismatch("isize_num".to_owned()))?, u8_num: u8::try_from( value .get::("u8_num") - .map_err(|e| Error::MissingField("u8_num".to_owned()))?, + .map_err(|_e| Error::MissingField("u8_num".to_owned()))?, ) .map_err(|_| Error::TypeMismatch("u8_num".to_owned()))?, u16_num: u16::try_from( value .get::("u16_num") - .map_err(|e| Error::MissingField("u16_num".to_owned()))?, + .map_err(|_e| Error::MissingField("u16_num".to_owned()))?, ) .map_err(|_| Error::TypeMismatch("u16_num".to_owned()))?, u32_num: u32::try_from( value .get::("u32_num") - .map_err(|e| Error::MissingField("u32_num".to_owned()))?, + .map_err(|_e| Error::MissingField("u32_num".to_owned()))?, ) .map_err(|_| Error::TypeMismatch("u32_num".to_owned()))?, u64_num: u64::try_from( value .get::("u64_num") - .map_err(|e| Error::MissingField("u64_num".to_owned()))?, + .map_err(|_e| Error::MissingField("u64_num".to_owned()))?, ) .map_err(|_| Error::TypeMismatch("u64_num".to_owned()))?, u128_num: u128::try_from( value .get::("u128_num") - .map_err(|e| Error::MissingField("u128_num".to_owned()))?, + .map_err(|_e| Error::MissingField("u128_num".to_owned()))?, ) .map_err(|_| Error::TypeMismatch("u128_num".to_owned()))?, i8_num: i8::try_from( value .get::("i8_num") - .map_err(|e| Error::MissingField("i8_num".to_owned()))?, + .map_err(|_e| Error::MissingField("i8_num".to_owned()))?, ) .map_err(|_| Error::TypeMismatch("i8_num".to_owned()))?, i16_num: i16::try_from( value .get::("i16_num") - .map_err(|e| Error::MissingField("i16_num".to_owned()))?, + .map_err(|_e| Error::MissingField("i16_num".to_owned()))?, ) .map_err(|_| Error::TypeMismatch("i16_num".to_owned()))?, i32_num: i32::try_from( value .get::("i32_num") - .map_err(|e| Error::MissingField("i32_num".to_owned()))?, + .map_err(|_e| Error::MissingField("i32_num".to_owned()))?, ) .map_err(|_| Error::TypeMismatch("i32_num".to_owned()))?, i64_num: value .get("i64_num") - .map_err(|e| Error::MissingField("i64_num".to_owned()))?, + .map_err(|_e| Error::MissingField("i64_num".to_owned()))?, i128_num: i128::try_from( value .get::("i128_num") - .map_err(|e| Error::MissingField("i128_num".to_owned()))?, + .map_err(|_e| Error::MissingField("i128_num".to_owned()))?, ) .map_err(|_| Error::TypeMismatch("i128_num".to_owned()))?, f32_num: value .get::("f32_num") - .map_err(|e| Error::MissingField("f32_num".to_owned()))? + .map_err(|_e| Error::MissingField("f32_num".to_owned()))? as f32, f64_num: value .get("f64_num") - .map_err(|e| Error::MissingField("f64_num".to_owned()))?, + .map_err(|_e| Error::MissingField("f64_num".to_owned()))?, usize_opt: match value.get::("usize_opt") { Ok(v) => Some( diff --git a/lib/src/stamps.rs b/lib/src/stamps.rs index ffd597d..65fea42 100644 --- a/lib/src/stamps.rs +++ b/lib/src/stamps.rs @@ -121,19 +121,19 @@ impl<'a> Neo4jMap<'a> { Neo4jMap::Row(value) => value .get::>(name) .map(|dt| dt.into()) - .map_err(|e| crate::Error::MissingField(name.to_owned())), + .map_err(|_e| crate::Error::MissingField(name.to_owned())), Neo4jMap::Node(value) => value .get::>(name) .map(|dt| dt.into()) - .map_err(|e| crate::Error::MissingField(name.to_owned())), + .map_err(|_e| crate::Error::MissingField(name.to_owned())), Neo4jMap::Relation(value) => value .get::>(name) .map(|dt| dt.into()) - .map_err(|e| crate::Error::MissingField(name.to_owned())), + .map_err(|_e| crate::Error::MissingField(name.to_owned())), Neo4jMap::UnboundedRelation(value) => value .get::>(name) .map(|dt| dt.into()) - .map_err(|e| crate::Error::MissingField(name.to_owned())), + .map_err(|_e| crate::Error::MissingField(name.to_owned())), } } } diff --git a/lib/tests/common/fixtures/company.rs b/lib/tests/common/fixtures/company.rs index 56582f7..29831ec 100644 --- a/lib/tests/common/fixtures/company.rs +++ b/lib/tests/common/fixtures/company.rs @@ -55,10 +55,10 @@ impl TryFrom for Company { Ok(Self { name: value .get("name") - .map_err(|e| Error::MissingField("name".to_owned()))?, + .map_err(|_e| Error::MissingField("name".to_owned()))?, state: value .get("state") - .map_err(|e| Error::MissingField("state".to_owned()))?, + .map_err(|_e| Error::MissingField("state".to_owned()))?, created: map.get_timestamp("created")?, updated: map.get_timestamp("updated")?, }) @@ -80,10 +80,10 @@ impl TryFrom for Company { Ok(Self { name: value .get("name") - .map_err(|e| Error::MissingField("name".to_owned()))?, + .map_err(|_e| Error::MissingField("name".to_owned()))?, state: value .get("state") - .map_err(|e| Error::MissingField("state".to_owned()))?, + .map_err(|_e| Error::MissingField("state".to_owned()))?, created: map.get_timestamp("created")?, updated: map.get_timestamp("updated")?, }) @@ -115,10 +115,10 @@ impl TryFrom for CompanyId { Ok(Self { name: value .get("name") - .map_err(|e| Error::MissingField("name".to_owned()))?, + .map_err(|_e| Error::MissingField("name".to_owned()))?, state: value .get("state") - .map_err(|e| Error::MissingField("state".to_owned()))?, + .map_err(|_e| Error::MissingField("state".to_owned()))?, }) } } @@ -148,10 +148,10 @@ impl TryFrom for CompanyId { Ok(Self { name: value .get("name") - .map_err(|e| Error::MissingField("name".to_owned()))?, + .map_err(|_e| Error::MissingField("name".to_owned()))?, state: value .get("state") - .map_err(|e| Error::MissingField("state".to_owned()))?, + .map_err(|_e| Error::MissingField("state".to_owned()))?, }) } } diff --git a/lib/tests/common/fixtures/person.rs b/lib/tests/common/fixtures/person.rs index 7ad81ed..1c3d14d 100644 --- a/lib/tests/common/fixtures/person.rs +++ b/lib/tests/common/fixtures/person.rs @@ -84,10 +84,10 @@ impl TryFrom for Person { Ok(Self { id: value .get("id") - .map_err(|e| Error::MissingField("id".to_owned()))?, + .map_err(|_e| Error::MissingField("id".to_owned()))?, name: value .get("name") - .map_err(|e| Error::MissingField("name".to_owned()))?, + .map_err(|_e| Error::MissingField("name".to_owned()))?, age: match value.get::("age") { Ok(age) => Some( age.try_into() @@ -115,10 +115,10 @@ impl TryFrom for Person { Ok(Self { id: value .get("id") - .map_err(|e| Error::MissingField("id".to_owned()))?, + .map_err(|_e| Error::MissingField("id".to_owned()))?, name: value .get("name") - .map_err(|e| Error::MissingField("name".to_owned()))?, + .map_err(|_e| Error::MissingField("name".to_owned()))?, age: match value.get::("age") { Ok(age) => Some( age.try_into() @@ -153,7 +153,7 @@ impl TryFrom for PersonId { Ok(Self { id: value .get("id") - .map_err(|e| Error::MissingField("id".to_owned()))?, + .map_err(|_e| Error::MissingField("id".to_owned()))?, }) } } @@ -181,7 +181,7 @@ impl TryFrom for PersonId { Ok(Self { id: value .get("id") - .map_err(|e| Error::MissingField("id".to_owned()))?, + .map_err(|_e| Error::MissingField("id".to_owned()))?, }) } }