Skip to content

Commit e132d65

Browse files
brooksprumoilya-bobyr
authored andcommitted
Upgrades to Rust 1.65.0 (#28741)
1 parent 1c55854 commit e132d65

File tree

97 files changed

+239
-257
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+239
-257
lines changed

account-decoder/src/parse_bpf_loader.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ pub fn parse_bpf_upgradeable_loader(
2727
BpfUpgradeableLoaderAccountType::Buffer(UiBuffer {
2828
authority: authority_address.map(|pubkey| pubkey.to_string()),
2929
data: UiAccountData::Binary(
30-
base64::encode(&data[offset as usize..]),
30+
base64::encode(&data[offset..]),
3131
UiAccountEncoding::Base64,
3232
),
3333
})
@@ -51,7 +51,7 @@ pub fn parse_bpf_upgradeable_loader(
5151
slot,
5252
authority: upgrade_authority_address.map(|pubkey| pubkey.to_string()),
5353
data: UiAccountData::Binary(
54-
base64::encode(&data[offset as usize..]),
54+
base64::encode(&data[offset..]),
5555
UiAccountEncoding::Base64,
5656
),
5757
})

account-decoder/src/parse_token.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ impl UiTokenAmount {
232232
pub fn real_number_string(&self) -> String {
233233
real_number_string(
234234
u64::from_str(&self.amount).unwrap_or_default(),
235-
self.decimals as u8,
235+
self.decimals,
236236
)
237237
}
238238

@@ -242,7 +242,7 @@ impl UiTokenAmount {
242242
} else {
243243
real_number_string_trimmed(
244244
u64::from_str(&self.amount).unwrap_or_default(),
245-
self.decimals as u8,
245+
self.decimals,
246246
)
247247
}
248248
}

bucket_map/src/bucket.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ impl<T: Clone + Copy> Bucket<T> {
210210
let mut m = Measure::start("bucket_create_key");
211211
let ix = Self::bucket_index_ix(index, key, random);
212212
for i in ix..ix + index.max_search() {
213-
let ii = i as u64 % index.capacity();
213+
let ii = i % index.capacity();
214214
if !index.is_free(ii) {
215215
continue;
216216
}

ci/docker-rust-nightly/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM solanalabs/rust:1.64.0
1+
FROM solanalabs/rust:1.65.0
22
ARG date
33

44
RUN set -x \

ci/docker-rust/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Note: when the rust version is changed also modify
22
# ci/rust-version.sh to pick up the new image tag
3-
FROM rust:1.64.0
3+
FROM rust:1.65.0
44

55
# Add Google Protocol Buffers for Libra's metrics library.
66
ENV PROTOC_VERSION 3.8.0

ci/rust-version.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@
1818
if [[ -n $RUST_STABLE_VERSION ]]; then
1919
stable_version="$RUST_STABLE_VERSION"
2020
else
21-
stable_version=1.64.0
21+
stable_version=1.65.0
2222
fi
2323

2424
if [[ -n $RUST_NIGHTLY_VERSION ]]; then
2525
nightly_version="$RUST_NIGHTLY_VERSION"
2626
else
27-
nightly_version=2022-09-22
27+
nightly_version=2022-11-02
2828
fi
2929

3030

clap-utils/src/keypair.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1055,7 +1055,7 @@ pub fn keypair_from_seed_phrase(
10551055
derivation_path: Option<DerivationPath>,
10561056
legacy: bool,
10571057
) -> Result<Keypair, Box<dyn error::Error>> {
1058-
let seed_phrase = prompt_password(&format!("[{}] seed phrase: ", keypair_name))?;
1058+
let seed_phrase = prompt_password(format!("[{}] seed phrase: ", keypair_name))?;
10591059
let seed_phrase = seed_phrase.trim();
10601060
let passphrase_prompt = format!(
10611061
"[{}] If this seed phrase has an associated passphrase, enter it now. Otherwise, press ENTER to continue: ",
@@ -1184,7 +1184,7 @@ mod tests {
11841184
));
11851185
let stdin = "stdin:".to_string();
11861186
assert!(matches!(
1187-
parse_signer_source(&stdin).unwrap(),
1187+
parse_signer_source(stdin).unwrap(),
11881188
SignerSource {
11891189
kind: SignerSourceKind::Stdin,
11901190
derivation_path: None,
@@ -1201,7 +1201,7 @@ mod tests {
12011201
));
12021202
let pubkey = Pubkey::new_unique();
12031203
assert!(
1204-
matches!(parse_signer_source(&pubkey.to_string()).unwrap(), SignerSource {
1204+
matches!(parse_signer_source(pubkey.to_string()).unwrap(), SignerSource {
12051205
kind: SignerSourceKind::Pubkey(p),
12061206
derivation_path: None,
12071207
legacy: false,
@@ -1241,7 +1241,7 @@ mod tests {
12411241
manufacturer: Manufacturer::Ledger,
12421242
pubkey: None,
12431243
};
1244-
assert!(matches!(parse_signer_source(&usb).unwrap(), SignerSource {
1244+
assert!(matches!(parse_signer_source(usb).unwrap(), SignerSource {
12451245
kind: SignerSourceKind::Usb(u),
12461246
derivation_path: None,
12471247
legacy: false,
@@ -1252,7 +1252,7 @@ mod tests {
12521252
pubkey: None,
12531253
};
12541254
let expected_derivation_path = Some(DerivationPath::new_bip44(Some(0), Some(0)));
1255-
assert!(matches!(parse_signer_source(&usb).unwrap(), SignerSource {
1255+
assert!(matches!(parse_signer_source(usb).unwrap(), SignerSource {
12561256
kind: SignerSourceKind::Usb(u),
12571257
derivation_path: d,
12581258
legacy: false,
@@ -1267,22 +1267,22 @@ mod tests {
12671267

12681268
let prompt = "prompt:".to_string();
12691269
assert!(matches!(
1270-
parse_signer_source(&prompt).unwrap(),
1270+
parse_signer_source(prompt).unwrap(),
12711271
SignerSource {
12721272
kind: SignerSourceKind::Prompt,
12731273
derivation_path: None,
12741274
legacy: false,
12751275
}
12761276
));
12771277
assert!(
1278-
matches!(parse_signer_source(&format!("file:{}", absolute_path_str)).unwrap(), SignerSource {
1278+
matches!(parse_signer_source(format!("file:{}", absolute_path_str)).unwrap(), SignerSource {
12791279
kind: SignerSourceKind::Filepath(p),
12801280
derivation_path: None,
12811281
legacy: false,
12821282
} if p == absolute_path_str)
12831283
);
12841284
assert!(
1285-
matches!(parse_signer_source(&format!("file:{}", relative_path_str)).unwrap(), SignerSource {
1285+
matches!(parse_signer_source(format!("file:{}", relative_path_str)).unwrap(), SignerSource {
12861286
kind: SignerSourceKind::Filepath(p),
12871287
derivation_path: None,
12881288
legacy: false,

clap-v3-utils/src/keypair.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1055,7 +1055,7 @@ pub fn keypair_from_seed_phrase(
10551055
derivation_path: Option<DerivationPath>,
10561056
legacy: bool,
10571057
) -> Result<Keypair, Box<dyn error::Error>> {
1058-
let seed_phrase = prompt_password(&format!("[{}] seed phrase: ", keypair_name))?;
1058+
let seed_phrase = prompt_password(format!("[{}] seed phrase: ", keypair_name))?;
10591059
let seed_phrase = seed_phrase.trim();
10601060
let passphrase_prompt = format!(
10611061
"[{}] If this seed phrase has an associated passphrase, enter it now. Otherwise, press ENTER to continue: ",
@@ -1184,7 +1184,7 @@ mod tests {
11841184
));
11851185
let stdin = "stdin:".to_string();
11861186
assert!(matches!(
1187-
parse_signer_source(&stdin).unwrap(),
1187+
parse_signer_source(stdin).unwrap(),
11881188
SignerSource {
11891189
kind: SignerSourceKind::Stdin,
11901190
derivation_path: None,
@@ -1201,7 +1201,7 @@ mod tests {
12011201
));
12021202
let pubkey = Pubkey::new_unique();
12031203
assert!(
1204-
matches!(parse_signer_source(&pubkey.to_string()).unwrap(), SignerSource {
1204+
matches!(parse_signer_source(pubkey.to_string()).unwrap(), SignerSource {
12051205
kind: SignerSourceKind::Pubkey(p),
12061206
derivation_path: None,
12071207
legacy: false,
@@ -1241,7 +1241,7 @@ mod tests {
12411241
manufacturer: Manufacturer::Ledger,
12421242
pubkey: None,
12431243
};
1244-
assert!(matches!(parse_signer_source(&usb).unwrap(), SignerSource {
1244+
assert!(matches!(parse_signer_source(usb).unwrap(), SignerSource {
12451245
kind: SignerSourceKind::Usb(u),
12461246
derivation_path: None,
12471247
legacy: false,
@@ -1252,7 +1252,7 @@ mod tests {
12521252
pubkey: None,
12531253
};
12541254
let expected_derivation_path = Some(DerivationPath::new_bip44(Some(0), Some(0)));
1255-
assert!(matches!(parse_signer_source(&usb).unwrap(), SignerSource {
1255+
assert!(matches!(parse_signer_source(usb).unwrap(), SignerSource {
12561256
kind: SignerSourceKind::Usb(u),
12571257
derivation_path: d,
12581258
legacy: false,
@@ -1267,22 +1267,22 @@ mod tests {
12671267

12681268
let prompt = "prompt:".to_string();
12691269
assert!(matches!(
1270-
parse_signer_source(&prompt).unwrap(),
1270+
parse_signer_source(prompt).unwrap(),
12711271
SignerSource {
12721272
kind: SignerSourceKind::Prompt,
12731273
derivation_path: None,
12741274
legacy: false,
12751275
}
12761276
));
12771277
assert!(
1278-
matches!(parse_signer_source(&format!("file:{}", absolute_path_str)).unwrap(), SignerSource {
1278+
matches!(parse_signer_source(format!("file:{}", absolute_path_str)).unwrap(), SignerSource {
12791279
kind: SignerSourceKind::Filepath(p),
12801280
derivation_path: None,
12811281
legacy: false,
12821282
} if p == absolute_path_str)
12831283
);
12841284
assert!(
1285-
matches!(parse_signer_source(&format!("file:{}", relative_path_str)).unwrap(), SignerSource {
1285+
matches!(parse_signer_source(format!("file:{}", relative_path_str)).unwrap(), SignerSource {
12861286
kind: SignerSourceKind::Filepath(p),
12871287
derivation_path: None,
12881288
legacy: false,

cli-config/src/config_input.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ impl ConfigInput {
8282
(SettingType::Explicit, json_rpc_cfg_url.to_string()),
8383
(SettingType::SystemDefault, Self::default_json_rpc_url()),
8484
]);
85-
(setting_type, normalize_to_url_if_moniker(&url_or_moniker))
85+
(setting_type, normalize_to_url_if_moniker(url_or_moniker))
8686
}
8787

8888
pub fn compute_keypair_path_setting(

cli-output/src/cli_output.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2221,7 +2221,7 @@ pub fn return_signers_data(tx: &Transaction, config: &ReturnSignersConfig) -> Cl
22212221
});
22222222
let message = if config.dump_transaction_message {
22232223
let message_data = tx.message_data();
2224-
Some(base64::encode(&message_data))
2224+
Some(base64::encode(message_data))
22252225
} else {
22262226
None
22272227
};

0 commit comments

Comments
 (0)