Repository navigation
Edition 2024 - #248
Edition 2024#248
Conversation
This library conforms to edition 2024 requirements already, except for some macros, that need to be reviewed. Signed-off-by: mulhern <amulhern@redhat.com>
|
Congratulations! One of the builds has completed. 🍾 You can install the built RPMs by following these steps:
Please note that the RPMs should be used only in a testing environment. |
1 similar comment
|
Congratulations! One of the builds has completed. 🍾 You can install the built RPMs by following these steps:
Please note that the RPMs should be used only in a testing environment. |
Signed-off-by: mulhern <amulhern@redhat.com>
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
Walkthrough
ChangesRust 2024 Edition Upgrade
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
cargo-fix identifies the following macro definitions that use expr. Since expr does not match certain patterns in edition 2021 that it does match in edition 2024, cargo-fix suggests using the more restrictive expr_2021. I don't think this is necessary in any of these macro definitions. Also reformat in a few places, since the new edition requires it. """ diff --git a/src/macros.rs b/src/macros.rs index 9ccc0b5..67c25bf4 100644 --- a/src/macros.rs +++ b/src/macros.rs @@ -3,7 +3,7 @@ // file, You can obtain one at http://mozilla.org/MPL/2.0/. macro_rules! str_ptr_to_owned { - ($str_ptr:expr) => { + ($str_ptr:expr_2021) => { unsafe { std::ffi::CStr::from_ptr($str_ptr) } .to_str()? .to_string() @@ -11,7 +11,7 @@ macro_rules! str_ptr_to_owned { } macro_rules! str_ptr_with_size_to_owned { - ($str_ptr:expr, $size:expr) => { + ($str_ptr:expr_2021, $size:expr_2021) => { std::ffi::CStr::from_bytes_with_nul(unsafe { std::slice::from_raw_parts($str_ptr as *const u8, $size) })? @@ -21,7 +21,7 @@ macro_rules! str_ptr_with_size_to_owned { } macro_rules! errno { - ($ret_expr:expr) => { + ($ret_expr:expr_2021) => { match $ret_expr { i if i == 0 => Ok(()), i if i < 0 => Err($crate::err::BlkidErr::LibErr(i64::from(i))), @@ -31,7 +31,7 @@ macro_rules! errno { } macro_rules! errno_ptr { - ($ret_expr:expr) => {{ + ($ret_expr:expr_2021) => {{ let ptr = $ret_expr; if ptr.is_null() { Err($crate::err::BlkidErr::LibErr(0)) @@ -42,7 +42,7 @@ macro_rules! errno_ptr { } macro_rules! option_ptr { - ($ret_expr:expr) => {{ + ($ret_expr:expr_2021) => {{ let ptr = $ret_expr; if ptr.is_null() { None @@ -53,7 +53,7 @@ macro_rules! option_ptr { } macro_rules! errno_with_ret { - ($ret_expr:expr) => { + ($ret_expr:expr_2021) => { match $ret_expr { i if i < 0 => Err($crate::err::BlkidErr::LibErr(i64::from(i))), i => Ok(i), @@ -62,7 +62,7 @@ macro_rules! errno_with_ret { } macro_rules! consts_enum_conv { - ($(#[$enum_meta:meta])* $enum_ident:ident <=> $conv_type:ty, $($(#[$var_meta:meta])* $variant:ident => $const:expr),+) => { + ($(#[$enum_meta:meta])* $enum_ident:ident <=> $conv_type:ty, $($(#[$var_meta:meta])* $variant:ident => $const:expr_2021),+) => { $( #[$enum_meta] )* Signed-off-by: mulhern <amulhern@redhat.com>
Related stratis-storage/project#843