[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 05/11] rust: qemu_api_macros: make pattern matching more read
From: |
Zhao Liu |
Subject: |
Re: [PATCH 05/11] rust: qemu_api_macros: make pattern matching more readable and efficient |
Date: |
Tue, 6 May 2025 15:48:07 +0800 |
On Mon, May 05, 2025 at 11:04:30AM +0200, Paolo Bonzini wrote:
> Date: Mon, 5 May 2025 11:04:30 +0200
> From: Paolo Bonzini <pbonzini@redhat.com>
> Subject: [PATCH 05/11] rust: qemu_api_macros: make pattern matching more
> readable and efficient
> X-Mailer: git-send-email 2.49.0
>
> "let ... else" is useful when visiting syntax trees; it avoids multiple
> levels of indentation and places the error close to the pattern.
>
> While at it, use "ref" to avoid moving the syntax tree objects.
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
> rust/qemu-api-macros/src/lib.rs | 84 +++++++++++++++------------------
> 1 file changed, 37 insertions(+), 47 deletions(-)
Good improvement!
Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
- [PATCH 07/11] rust: qom: fix TODO about zeroability of classes, (continued)
- [PATCH 07/11] rust: qom: fix TODO about zeroability of classes, Paolo Bonzini, 2025/05/05
- [PATCH 04/11] rust: let bilge use "let ... else", Paolo Bonzini, 2025/05/05
- [PATCH 06/11] rust: use MaybeUninit::zeroed() in const context, Paolo Bonzini, 2025/05/05
- [PATCH 08/11] rust: enable clippy::ptr_cast_constness, Paolo Bonzini, 2025/05/05
- [PATCH 05/11] rust: qemu_api_macros: make pattern matching more readable and efficient, Paolo Bonzini, 2025/05/05
- Re: [PATCH 05/11] rust: qemu_api_macros: make pattern matching more readable and efficient,
Zhao Liu <=
- [PATCH 09/11] rust: remove offset_of replacement, Paolo Bonzini, 2025/05/05
- [PATCH 10/11] rust: replace c_str! with c"" literals, Paolo Bonzini, 2025/05/05
- [PATCH 11/11] docs: rust: update for newer minimum supported version, Paolo Bonzini, 2025/05/05