Skip to content

Commit 649b9d6

Browse files
Fix clippy 1.86.0 (#3654)
1 parent 1a2b6bd commit 649b9d6

File tree

5 files changed

+11
-9
lines changed

5 files changed

+11
-9
lines changed

avm/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ pub fn install_version(
251251
let target = core::str::from_utf8(&output.stdout)?
252252
.lines()
253253
.find(|line| line.starts_with("host:"))
254-
.and_then(|line| line.split(':').last())
254+
.and_then(|line| line.split(':').next_back())
255255
.ok_or_else(|| anyhow!("`host` not found from `rustc -vV` output"))?
256256
.trim();
257257
let ext = if cfg!(target_os = "windows") {

lang/src/accounts/account_loader.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ use std::ops::DerefMut;
2323
/// for example, the [`Account`](crate::accounts::account::Account). Namely,
2424
/// one must call
2525
/// - `load_init` after initializing an account (this will ignore the missing
26-
/// account discriminator that gets added only after the user's instruction code)
26+
/// account discriminator that gets added only after the user's instruction code)
2727
/// - `load` when the account is not mutable
2828
/// - `load_mut` when the account is mutable
2929
///

lang/src/accounts/interface.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@ use std::ops::Deref;
5959
/// The required constraints are as follows:
6060
///
6161
/// - `program` is the account of the program itself.
62-
/// Its constraint checks that `program_data` is the account that contains the program's upgrade authority.
63-
/// Implicitly, this checks that `program` is a BPFUpgradeable program (`program.programdata_address()?`
64-
/// will be `None` if it's not).
62+
/// Its constraint checks that `program_data` is the account that contains the program's upgrade authority.
63+
/// Implicitly, this checks that `program` is a BPFUpgradeable program (`program.programdata_address()?`
64+
/// will be `None` if it's not).
6565
/// - `program_data`'s constraint checks that its upgrade authority is the `authority` account.
6666
/// - Finally, `authority` needs to sign the transaction.
6767
///

lang/src/accounts/program.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@ use std::ops::Deref;
5959
/// The required constraints are as follows:
6060
///
6161
/// - `program` is the account of the program itself.
62-
/// Its constraint checks that `program_data` is the account that contains the program's upgrade authority.
63-
/// Implicitly, this checks that `program` is a BPFUpgradeable program (`program.programdata_address()?`
64-
/// will be `None` if it's not).
62+
/// Its constraint checks that `program_data` is the account that contains the program's upgrade authority.
63+
/// Implicitly, this checks that `program` is a BPFUpgradeable program (`program.programdata_address()?`
64+
/// will be `None` if it's not).
6565
/// - `program_data`'s constraint checks that its upgrade authority is the `authority` account.
6666
/// - Finally, `authority` needs to sign the transaction.
6767
///

lang/syn/src/parser/program/instructions.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,9 @@ pub fn parse_return(method: &syn::ItemFn) -> ParseResult<IxReturn> {
129129
// Assume unit return by default
130130
let default_generic_arg = syn::GenericArgument::Type(syn::parse_str("()").unwrap());
131131
let generic_args = match &ty.path.segments.last().unwrap().arguments {
132-
syn::PathArguments::AngleBracketed(params) => params.args.iter().last().unwrap(),
132+
syn::PathArguments::AngleBracketed(params) => {
133+
params.args.iter().next_back().unwrap()
134+
}
133135
_ => &default_generic_arg,
134136
};
135137
let ty = match generic_args {

0 commit comments

Comments
 (0)