Bump Rust to 1.59.0

This commit is contained in:
Minseong Jang
2022-02-28 09:57:16 +09:00
parent 6f0df5a4b8
commit 0b839020cf
7 changed files with 9 additions and 9 deletions

View File

@@ -881,6 +881,7 @@ impl Dtype {
}
}
#[must_use]
pub fn set_const(self, is_const: bool) -> Self {
match self {
Self::Unit { .. } => Self::Unit { is_const },
@@ -998,6 +999,7 @@ impl Dtype {
}
}
#[must_use]
pub fn set_signed(self, is_signed: bool) -> Self {
match self {
Self::Int {

View File

@@ -1037,12 +1037,11 @@ impl Byte {
let padding = std::cmp::max(inner_size, inner_align) - inner_size;
values
.iter()
.map(|v| {
.flat_map(|v| {
let mut result = Self::value_to_bytes(v, structs);
result.extend(iter::repeat(Byte::Undef).take(padding));
result
})
.flatten()
.collect()
}
Value::Struct { name, fields } => {

View File

@@ -740,6 +740,7 @@ impl Constant {
matches!(self, Self::Undef { .. })
}
#[must_use]
pub fn typecast(self, target_dtype: Dtype) -> Self {
if self.dtype() == target_dtype {
return self;

View File

@@ -28,7 +28,7 @@ impl WriteLine for TranslationUnit {
} else {
"%anon"
},
f.deref().to_string()
f.deref()
)
})
.collect::<Vec<_>>()