Module: Mesa Branch: main Commit: 93d5d85d35da164638e9d0fbdd6fbe6de3f6e1fa URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=93d5d85d35da164638e9d0fbdd6fbe6de3f6e1fa
Author: Karol Herbst <[email protected]> Date: Mon Oct 2 23:33:54 2023 +0200 rusticl: fix clippys bool_to_int_with_if New in clippy-1.65 Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25538> --- src/gallium/frontends/rusticl/api/device.rs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/gallium/frontends/rusticl/api/device.rs b/src/gallium/frontends/rusticl/api/device.rs index 549eb3c4b16..43fee832c22 100644 --- a/src/gallium/frontends/rusticl/api/device.rs +++ b/src/gallium/frontends/rusticl/api/device.rs @@ -199,13 +199,9 @@ impl CLInfo<cl_device_info> for cl_device_id { } CL_DEVICE_NAME => cl_prop::<&str>(&dev.screen().name()), CL_DEVICE_NATIVE_VECTOR_WIDTH_CHAR => cl_prop::<cl_uint>(1), - CL_DEVICE_NATIVE_VECTOR_WIDTH_DOUBLE => { - cl_prop::<cl_uint>(if dev.fp64_supported() { 1 } else { 0 }) - } + CL_DEVICE_NATIVE_VECTOR_WIDTH_DOUBLE => cl_prop::<cl_uint>(dev.fp64_supported().into()), CL_DEVICE_NATIVE_VECTOR_WIDTH_FLOAT => cl_prop::<cl_uint>(1), - CL_DEVICE_NATIVE_VECTOR_WIDTH_HALF => { - cl_prop::<cl_uint>(if dev.fp16_supported() { 1 } else { 0 }) - } + CL_DEVICE_NATIVE_VECTOR_WIDTH_HALF => cl_prop::<cl_uint>(dev.fp16_supported().into()), CL_DEVICE_NATIVE_VECTOR_WIDTH_INT => cl_prop::<cl_uint>(1), CL_DEVICE_NATIVE_VECTOR_WIDTH_LONG => cl_prop::<cl_uint>(1), CL_DEVICE_NATIVE_VECTOR_WIDTH_SHORT => cl_prop::<cl_uint>(1), @@ -241,11 +237,11 @@ impl CLInfo<cl_device_info> for cl_device_id { CL_DEVICE_PREFERRED_PLATFORM_ATOMIC_ALIGNMENT => cl_prop::<cl_uint>(0), CL_DEVICE_PREFERRED_VECTOR_WIDTH_CHAR => cl_prop::<cl_uint>(1), CL_DEVICE_PREFERRED_VECTOR_WIDTH_DOUBLE => { - cl_prop::<cl_uint>(if dev.fp64_supported() { 1 } else { 0 }) + cl_prop::<cl_uint>(dev.fp64_supported().into()) } CL_DEVICE_PREFERRED_VECTOR_WIDTH_FLOAT => cl_prop::<cl_uint>(1), CL_DEVICE_PREFERRED_VECTOR_WIDTH_HALF => { - cl_prop::<cl_uint>(if dev.fp16_supported() { 1 } else { 0 }) + cl_prop::<cl_uint>(dev.fp16_supported().into()) } CL_DEVICE_PREFERRED_VECTOR_WIDTH_INT => cl_prop::<cl_uint>(1), CL_DEVICE_PREFERRED_VECTOR_WIDTH_LONG => cl_prop::<cl_uint>(1),
