lang: Fix redundant split() (#960)

This commit is contained in:
wan-nyan-wan 2021-11-14 00:46:48 +09:00 committed by GitHub
parent 9b5242ea97
commit ddd5ad7a48
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -61,10 +61,12 @@ pub fn account(
) -> proc_macro::TokenStream {
let mut namespace = "".to_string();
let mut is_zero_copy = false;
if args.to_string().split(',').count() > 2 {
let args_str = args.to_string();
let args: Vec<&str> = args_str.split(',').collect();
if args.len() > 2 {
panic!("Only two args are allowed to the account attribute.")
}
for arg in args.to_string().split(',') {
for arg in args {
let ns = arg
.to_string()
.replace("\"", "")