Skip to content

Commit

Permalink
Fix latest Clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
marc0246 committed Feb 24, 2025
1 parent 8e787d5 commit 2fc86c6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion vulkano/autogen/features.rs
Original file line number Diff line number Diff line change
Expand Up @@ -760,7 +760,7 @@ fn sorted_structs<'a>(
.find_map(|s| s.strip_prefix("VK_VERSION_"))
{
let (major, minor) = version.split_once('_').unwrap();
major.parse::<i32>().unwrap() << 22 | minor.parse::<i32>().unwrap() << 12
(major.parse::<i32>().unwrap() << 22) | (minor.parse::<i32>().unwrap() << 12)
} else if provided_by.iter().any(|s| s.starts_with("VK_KHR_")) {
i32::MAX - 2
} else if provided_by.iter().any(|s| s.starts_with("VK_EXT_")) {
Expand Down
2 changes: 1 addition & 1 deletion vulkano/autogen/properties.rs
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ fn sorted_structs<'a>(
.find_map(|s| s.strip_prefix("VK_VERSION_"))
{
let (major, minor) = version.split_once('_').unwrap();
major.parse::<i32>().unwrap() << 22 | minor.parse::<i32>().unwrap() << 12
(major.parse::<i32>().unwrap() << 22) | (minor.parse::<i32>().unwrap() << 12)
} else if provided_by.iter().any(|s| s.starts_with("VK_KHR_")) {
i32::MAX - 2
} else if provided_by.iter().any(|s| s.starts_with("VK_EXT_")) {
Expand Down
6 changes: 3 additions & 3 deletions vulkano/src/shader/reflect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1172,7 +1172,7 @@ pub(crate) fn get_constant(spirv: &Spirv, id: Id) -> Option<u64> {
match spirv.id(id).instruction() {
Instruction::Constant { value, .. } => match value.len() {
1 => Some(value[0] as u64),
2 => Some(value[0] as u64 | (value[1] as u64) << 32),
2 => Some(value[0] as u64 | ((value[1] as u64) << 32)),
_ => panic!("constant {} is larger than 64 bits", id),
},
_ => None,
Expand All @@ -1187,7 +1187,7 @@ pub(crate) fn get_constant_composite(spirv: &Spirv, id: Id) -> Option<SmallVec<[
.map(|&id| match spirv.id(id).instruction() {
Instruction::Constant { value, .. } => match value.len() {
1 => value[0] as u64,
2 => value[0] as u64 | (value[1] as u64) << 32,
2 => value[0] as u64 | ((value[1] as u64) << 32),
_ => panic!("constant {} is larger than 64 bits", id),
},
_ => unreachable!(),
Expand All @@ -1206,7 +1206,7 @@ pub(crate) fn get_constant_float_composite(spirv: &Spirv, id: Id) -> Option<Smal
.map(|&id| match spirv.id(id).instruction() {
Instruction::Constant { value, .. } => match value.len() {
1 => f32::from_bits(value[0]) as f64,
2 => f64::from_bits(value[0] as u64 | (value[1] as u64) << 32),
2 => f64::from_bits(value[0] as u64 | ((value[1] as u64) << 32)),
_ => panic!("constant {} is larger than 64 bits", id),
},
_ => unreachable!(),
Expand Down

0 comments on commit 2fc86c6

Please sign in to comment.