Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/dfx/src/commands/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ fn motoko_compile(cache: &dyn Cache, params: &MotokoParams<'_>, assets: &AssetMa
let mut rng = thread_rng();
let input_path = input_path.with_extension(format!("mo-{}", rng.gen::<u64>()));
std::fs::write(&input_path, content.as_bytes())?;
input_path.clone()
input_path
} else {
params.input.to_path_buf()
};
Expand Down
4 changes: 2 additions & 2 deletions src/dfx/src/commands/canister/call.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ pub fn exec(env: &dyn Environment, args: &ArgMatches<'_>) -> DfxResult {
let mut runtime = Runtime::new().expect("Unable to create a runtime");
if is_query {
let future = query(
client.clone(),
client,
canister_id,
method_name.to_owned(),
arg_value.map(Blob::from),
Expand All @@ -185,7 +185,7 @@ pub fn exec(env: &dyn Environment, args: &ArgMatches<'_>) -> DfxResult {
println!("0x{}", String::from(request_id));
Ok(())
} else {
wait_on_request_status(&client.clone(), request_id)
wait_on_request_status(&client, request_id)
}
}
}
4 changes: 3 additions & 1 deletion src/dfx/src/commands/canister/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ pub fn exec(env: &dyn Environment, args: &ArgMatches<'_>) -> DfxResult {
None
};

eprintln!(r#"The 'canister query' command has been deprecated. Please use the 'canister call' command."#);
eprintln!(
r#"The 'canister query' command has been deprecated. Please use the 'canister call' command."#
);

let client = env
.get_client()
Expand Down
8 changes: 3 additions & 5 deletions src/dfx/src/lib/api_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ mod tests {
),
(
Value::Text("method_name".to_string()),
Value::Text(method_name.clone()),
Value::Text(method_name),
),
(Value::Text("arg".to_string()), Value::Bytes(vec![])),
]
Expand Down Expand Up @@ -360,9 +360,7 @@ mod tests {
serde_cbor::from_slice(&serde_cbor::to_vec(&response).unwrap()).unwrap();

let expected = ReadResponse::Replied {
reply: Some(QueryResponseReply {
arg: Blob(arg.clone()),
}),
reply: Some(QueryResponseReply { arg: Blob(arg) }),
};

assert_eq!(actual, expected);
Expand Down Expand Up @@ -434,7 +432,7 @@ mod tests {

let expected: ReadResponse<QueryResponseReply> = ReadResponse::Rejected {
reject_code: 1, // ReadRejectCode::SysFatal,
reject_message: reject_message.clone(),
reject_message,
};

assert_eq!(actual, expected);
Expand Down
2 changes: 1 addition & 1 deletion src/dfx_derive/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ impl Variant {
.iter()
.map(|ident| {
let ident = ident.to_string();
let var = format!("__field{}", ident.to_string());
let var = format!("__field{}", ident);
syn::parse_str(&var).unwrap()
})
.collect();
Expand Down
2 changes: 1 addition & 1 deletion src/serde_idl/src/de.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ impl<'de> IDLDeserialize<'de> {
.types
.pop_front()
.ok_or_else(|| Error::msg("No more values to deserialize"))?;
self.de.current_type.push_back(ty.clone());
self.de.current_type.push_back(ty);

let v = T::deserialize(&mut self.de).map_err(|e| self.de.dump_error_state(e))?;
if self.de.current_type.is_empty() && self.de.field_name.is_none() {
Expand Down