Skip to content

Commit

Permalink
refactor: Drop redundant closures
Browse files Browse the repository at this point in the history
  • Loading branch information
AiyionPrime committed Jun 18, 2024
1 parent b6648bb commit 8bee67e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/src/client/session/services/attributes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ impl Session {
// Turn the enums into ExtensionObjects
let history_update_details = history_update_details
.iter()
.map(|action| ExtensionObject::from(action))
.map(ExtensionObject::from)
.collect::<Vec<ExtensionObject>>();

let request = HistoryUpdateRequest {
Expand Down
2 changes: 1 addition & 1 deletion lib/src/types/service_types/impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ impl<'de> Deserialize<'de> for DataSetFieldFlags {
{
deserializer
.deserialize_i16(Int16Visitor)
.map(|v| DataSetFieldFlags::from_bits_truncate(v))
.map(DataSetFieldFlags::from_bits_truncate)
}
}

Expand Down
6 changes: 3 additions & 3 deletions lib/src/types/variant_json.rs
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ impl<'de> serde::de::Visitor<'de> for VariantVisitor {
if v.is_null() {
Ok(Variant::String(UAString::null()))
} else {
json_as_value(body, "UAString").map(|v| Variant::String(v))
json_as_value(body, "UAString").map(Variant::String)
}
} else {
Ok(Variant::String(UAString::null()))
Expand All @@ -469,14 +469,14 @@ impl<'de> serde::de::Visitor<'de> for VariantVisitor {
if v.is_null() {
Ok(Variant::ByteString(ByteString::null()))
} else {
json_as_value(body, "ByteString").map(|v| Variant::ByteString(v))
json_as_value(body, "ByteString").map(Variant::ByteString)
}
} else {
Ok(Variant::ByteString(ByteString::null()))
}
}
t if t == VariantJsonId::XmlElement as u32 => {
json_as_value(body, "XmlElement").map(|v| Variant::XmlElement(v))
json_as_value(body, "XmlElement").map(Variant::XmlElement)
}
t if t == VariantJsonId::NodeId as u32 => {
json_as_value(body, "NodeId").map(|v| Variant::NodeId(Box::new(v)))
Expand Down

0 comments on commit 8bee67e

Please sign in to comment.