Explorar el Código

Fix `1.79.0-nightly` warnings (#2896)

acheron hace 1 año
padre
commit
c7ccbb8f62

+ 0 - 1
lang/attribute/account/src/id.rs

@@ -10,7 +10,6 @@ extern crate proc_macro;
 
 use proc_macro2::{Delimiter, Span, TokenTree};
 use quote::{quote, ToTokens};
-use std::convert::TryFrom;
 use syn::{
     bracketed,
     parse::{Parse, ParseStream, Result},

+ 0 - 1
lang/src/accounts/program.rs

@@ -9,7 +9,6 @@ use solana_program::bpf_loader_upgradeable::{self, UpgradeableLoaderState};
 use solana_program::instruction::AccountMeta;
 use solana_program::pubkey::Pubkey;
 use std::collections::BTreeSet;
-use std::convert::TryFrom;
 use std::fmt;
 use std::marker::PhantomData;
 use std::ops::Deref;

+ 0 - 4
lang/src/accounts/system_account.rs

@@ -2,11 +2,7 @@
 
 use crate::error::ErrorCode;
 use crate::*;
-use solana_program::account_info::AccountInfo;
-use solana_program::instruction::AccountMeta;
-use solana_program::pubkey::Pubkey;
 use solana_program::system_program;
-use std::collections::BTreeSet;
 use std::ops::Deref;
 
 /// Type validating that the account is owned by the system program

+ 0 - 1
lang/src/idl.rs

@@ -18,7 +18,6 @@
 //! Anchor programs. To remove them, one can use the `no-idl` feature.
 
 use crate::prelude::*;
-use solana_program::pubkey::Pubkey;
 
 // The first 8 bytes of an instruction to create or modify the IDL account. This
 // instruction is defined outside the main program's instruction enum, so that

+ 0 - 1
lang/syn/src/codegen/accounts/constraints.rs

@@ -1,6 +1,5 @@
 use quote::quote;
 use std::collections::HashSet;
-use syn::Expr;
 
 use crate::*;
 

+ 1 - 1
lang/syn/src/hash.rs

@@ -3,7 +3,7 @@
 
 use serde::{Deserialize, Serialize};
 use sha2::{Digest, Sha256};
-use std::{convert::TryFrom, fmt, mem, str::FromStr};
+use std::{fmt, mem, str::FromStr};
 use thiserror::Error;
 
 pub const HASH_BYTES: usize = 32;

+ 2 - 6
lang/syn/src/parser/accounts/constraints.rs

@@ -1,10 +1,6 @@
 use crate::*;
-use syn::ext::IdentExt;
-use syn::parse::{Error as ParseError, Parse, ParseStream, Result as ParseResult};
-use syn::punctuated::Punctuated;
-use syn::spanned::Spanned;
-use syn::token::Comma;
-use syn::{bracketed, Expr, Ident, Token};
+use syn::parse::{Error as ParseError, Result as ParseResult};
+use syn::{bracketed, Token};
 
 pub fn parse(f: &syn::Field, f_ty: Option<&Ty>) -> ParseResult<ConstraintGroup> {
     let mut constraints = ConstraintGroupBuilder::new(f_ty);

+ 0 - 4
lang/syn/src/parser/accounts/mod.rs

@@ -5,10 +5,6 @@ pub mod event_cpi;
 use crate::parser::docs;
 use crate::*;
 use syn::parse::{Error as ParseError, Result as ParseResult};
-use syn::punctuated::Punctuated;
-use syn::spanned::Spanned;
-use syn::token::Comma;
-use syn::Expr;
 use syn::Path;
 
 pub fn parse(accounts_struct: &syn::ItemStruct) -> ParseResult<AccountsStruct> {

+ 1 - 2
spl/src/token.rs

@@ -1,9 +1,8 @@
 use anchor_lang::solana_program::account_info::AccountInfo;
-
 use anchor_lang::solana_program::program_pack::Pack;
 use anchor_lang::solana_program::pubkey::Pubkey;
+use anchor_lang::Result;
 use anchor_lang::{context::CpiContext, Accounts};
-use anchor_lang::{solana_program, Result};
 use std::ops::Deref;
 
 pub use spl_token;

+ 1 - 2
spl/src/token_2022.rs

@@ -1,8 +1,7 @@
 use anchor_lang::solana_program::account_info::AccountInfo;
-
 use anchor_lang::solana_program::pubkey::Pubkey;
+use anchor_lang::Result;
 use anchor_lang::{context::CpiContext, Accounts};
-use anchor_lang::{solana_program, Result};
 
 pub use spl_token_2022;
 pub use spl_token_2022::ID;