Skip to content

Commit 6f8170e

Browse files
committed
Fix clippy issues
1 parent 3999a88 commit 6f8170e

File tree

4 files changed

+10
-11
lines changed

4 files changed

+10
-11
lines changed

notarization-rs/src/core/move_utils.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ where
4949

5050
let object_data = object_response
5151
.data
52-
.ok_or_else(|| Error::FailedToParseTag(format!("Object {} not found", object_id)))?;
52+
.ok_or_else(|| Error::FailedToParseTag(format!("Object {object_id} not found")))?;
5353

5454
let full_type_str = object_data
5555
.object_type()
@@ -59,7 +59,7 @@ where
5959
let type_param_str = parse_type(&full_type_str)?;
6060

6161
let tag = TypeTag::from_str(&type_param_str)
62-
.map_err(|e| Error::FailedToParseTag(format!("Failed to parse tag '{}': {}", type_param_str, e)))?;
62+
.map_err(|e| Error::FailedToParseTag(format!("Failed to parse tag '{type_param_str}': {e}")))?;
6363

6464
Ok(tag)
6565
}
@@ -78,8 +78,7 @@ pub(crate) fn parse_type(full_type: &str) -> Result<String, Error> {
7878
Ok(full_type[start + 1..end].to_string())
7979
} else {
8080
Err(Error::FailedToParseTag(format!(
81-
"Could not parse type parameter from {}",
82-
full_type
81+
"Could not parse type parameter from {full_type}"
8382
)))
8483
}
8584
}

notarization-rs/src/core/operations.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,13 @@ impl NotarizationImpl {
6666

6767
vec![
6868
ptb.obj(ObjectArg::ImmOrOwnedObject(notarization))
69-
.map_err(|e| Error::InvalidArgument(format!("Failed to create object argument: {}", e)))?,
69+
.map_err(|e| Error::InvalidArgument(format!("Failed to create object argument: {e}")))?,
7070
]
7171
};
7272
// Add additional arguments
7373
args.extend(
7474
additional_args(&mut ptb)
75-
.map_err(|e| Error::InvalidArgument(format!("Failed to add additional arguments: {}", e)))?,
75+
.map_err(|e| Error::InvalidArgument(format!("Failed to add additional arguments: {e}")))?,
7676
);
7777

7878
// Create method identifier
@@ -316,12 +316,12 @@ pub(crate) trait NotarizationOperations {
316316
let tag = vec![move_utils::get_type_tag(client, &object_id).await?];
317317
let recipient = ptb
318318
.pure(recipient)
319-
.map_err(|e| Error::InvalidArgument(format!("Failed to create recipient argument: {}", e)))?;
319+
.map_err(|e| Error::InvalidArgument(format!("Failed to create recipient argument: {e}")))?;
320320

321321
let notarization = move_utils::get_object_ref_by_id(client, &object_id).await?;
322322
let notarization = ptb
323323
.obj(ObjectArg::ImmOrOwnedObject(notarization))
324-
.map_err(|e| Error::InvalidArgument(format!("Failed to create notarization argument: {}", e)))?;
324+
.map_err(|e| Error::InvalidArgument(format!("Failed to create notarization argument: {e}")))?;
325325

326326
let clock = move_utils::get_clock_ref(&mut ptb);
327327

notarization-rs/src/core/transactions/create.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,13 +187,13 @@ impl<M: Clone + OptionalSend + OptionalSync> Transaction for CreateNotarization<
187187
let notarization_id = match method {
188188
NotarizationMethod::Dynamic => {
189189
let event: Event<DynamicNotarizationCreated> = serde_json::from_value(data.parsed_json.clone())
190-
.map_err(|e| Error::TransactionUnexpectedResponse(format!("failed to parse event: {}", e)))?;
190+
.map_err(|e| Error::TransactionUnexpectedResponse(format!("failed to parse event: {e}")))?;
191191

192192
event.data.notarization_id
193193
}
194194
NotarizationMethod::Locked => {
195195
let event: Event<LockedNotarizationCreated> = serde_json::from_value(data.parsed_json.clone())
196-
.map_err(|e| Error::TransactionUnexpectedResponse(format!("failed to parse event: {}", e)))?;
196+
.map_err(|e| Error::TransactionUnexpectedResponse(format!("failed to parse event: {e}")))?;
197197

198198
event.data.notarization_id
199199
}

notarization-rs/src/core/types/timelock.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,6 @@ pub(super) fn new_none(ptb: &mut Ptb, package_id: ObjectID) -> Result<Argument,
101101

102102
impl MoveType for TimeLock {
103103
fn move_type(package: ObjectID) -> TypeTag {
104-
TypeTag::from_str(format!("{}::timelock::TimeLock", package).as_str()).expect("failed to create type tag")
104+
TypeTag::from_str(format!("{package}::timelock::TimeLock").as_str()).expect("failed to create type tag")
105105
}
106106
}

0 commit comments

Comments
 (0)