acheron 6 mesiacov pred
rodič
commit
649b9d6c5e

+ 1 - 1
avm/src/lib.rs

@@ -251,7 +251,7 @@ pub fn install_version(
         let target = core::str::from_utf8(&output.stdout)?
             .lines()
             .find(|line| line.starts_with("host:"))
-            .and_then(|line| line.split(':').last())
+            .and_then(|line| line.split(':').next_back())
             .ok_or_else(|| anyhow!("`host` not found from `rustc -vV` output"))?
             .trim();
         let ext = if cfg!(target_os = "windows") {

+ 1 - 1
lang/src/accounts/account_loader.rs

@@ -23,7 +23,7 @@ use std::ops::DerefMut;
 /// for example, the [`Account`](crate::accounts::account::Account). Namely,
 /// one must call
 /// - `load_init` after initializing an account (this will ignore the missing
-///    account discriminator that gets added only after the user's instruction code)
+///   account discriminator that gets added only after the user's instruction code)
 /// - `load` when the account is not mutable
 /// - `load_mut` when the account is mutable
 ///

+ 3 - 3
lang/src/accounts/interface.rs

@@ -59,9 +59,9 @@ use std::ops::Deref;
 /// The required constraints are as follows:
 ///
 /// - `program` is the account of the program itself.
-///    Its constraint checks that `program_data` is the account that contains the program's upgrade authority.
-///    Implicitly, this checks that `program` is a BPFUpgradeable program (`program.programdata_address()?`
-///    will be `None` if it's not).
+///   Its constraint checks that `program_data` is the account that contains the program's upgrade authority.
+///   Implicitly, this checks that `program` is a BPFUpgradeable program (`program.programdata_address()?`
+///   will be `None` if it's not).
 /// - `program_data`'s constraint checks that its upgrade authority is the `authority` account.
 /// - Finally, `authority` needs to sign the transaction.
 ///

+ 3 - 3
lang/src/accounts/program.rs

@@ -59,9 +59,9 @@ use std::ops::Deref;
 /// The required constraints are as follows:
 ///
 /// - `program` is the account of the program itself.
-///    Its constraint checks that `program_data` is the account that contains the program's upgrade authority.
-///    Implicitly, this checks that `program` is a BPFUpgradeable program (`program.programdata_address()?`
-///    will be `None` if it's not).
+///   Its constraint checks that `program_data` is the account that contains the program's upgrade authority.
+///   Implicitly, this checks that `program` is a BPFUpgradeable program (`program.programdata_address()?`
+///   will be `None` if it's not).
 /// - `program_data`'s constraint checks that its upgrade authority is the `authority` account.
 /// - Finally, `authority` needs to sign the transaction.
 ///

+ 3 - 1
lang/syn/src/parser/program/instructions.rs

@@ -129,7 +129,9 @@ pub fn parse_return(method: &syn::ItemFn) -> ParseResult<IxReturn> {
             // Assume unit return by default
             let default_generic_arg = syn::GenericArgument::Type(syn::parse_str("()").unwrap());
             let generic_args = match &ty.path.segments.last().unwrap().arguments {
-                syn::PathArguments::AngleBracketed(params) => params.args.iter().last().unwrap(),
+                syn::PathArguments::AngleBracketed(params) => {
+                    params.args.iter().next_back().unwrap()
+                }
                 _ => &default_generic_arg,
             };
             let ty = match generic_args {