Upgrade to Rust v1.49.0
This commit is contained in:
@ -70,11 +70,7 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
fn build_bpf_package(
|
||||
config: &Config,
|
||||
target_directory: &PathBuf,
|
||||
package: &cargo_metadata::Package,
|
||||
) {
|
||||
fn build_bpf_package(config: &Config, target_directory: &Path, package: &cargo_metadata::Package) {
|
||||
let program_name = {
|
||||
let cdylib_targets = package
|
||||
.targets
|
||||
|
@ -67,11 +67,7 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
fn test_bpf_package(
|
||||
config: &Config,
|
||||
target_directory: &PathBuf,
|
||||
package: &cargo_metadata::Package,
|
||||
) {
|
||||
fn test_bpf_package(config: &Config, target_directory: &Path, package: &cargo_metadata::Package) {
|
||||
let set_test_bpf_feature = package.features.contains_key("test-bpf");
|
||||
|
||||
let bpf_out_dir = config
|
||||
|
@ -950,6 +950,17 @@ impl<T> From<Option<T>> for COption<T> {
|
||||
}
|
||||
}
|
||||
|
||||
#[rustversion::since(1.49.0)]
|
||||
impl<T> From<COption<T>> for Option<T> {
|
||||
fn from(coption: COption<T>) -> Self {
|
||||
match coption {
|
||||
COption::Some(value) => Some(value),
|
||||
COption::None => None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[rustversion::before(1.49.0)] // Remove `Into` once the BPF toolchain upgrades to 1.49.0 or newer
|
||||
impl<T> Into<Option<T>> for COption<T> {
|
||||
fn into(self) -> Option<T> {
|
||||
match self {
|
||||
|
@ -43,7 +43,7 @@ pub trait Pack: Sealed {
|
||||
if input.len() != Self::LEN {
|
||||
return Err(ProgramError::InvalidAccountData);
|
||||
}
|
||||
Ok(Self::unpack_from_slice(input)?)
|
||||
Self::unpack_from_slice(input)
|
||||
}
|
||||
|
||||
/// Pack into slice
|
||||
|
@ -125,9 +125,9 @@ impl fmt::Display for Signature {
|
||||
}
|
||||
}
|
||||
|
||||
impl Into<[u8; 64]> for Signature {
|
||||
fn into(self) -> [u8; 64] {
|
||||
<GenericArray<u8, U64> as Into<[u8; 64]>>::into(self.0)
|
||||
impl From<Signature> for [u8; 64] {
|
||||
fn from(signature: Signature) -> Self {
|
||||
signature.0.into()
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user