fix: optimize ownership handling in patch macro for better performance

This commit is contained in:
Tunglies
2025-11-04 10:14:15 +08:00
Unverified
parent 28a78464e1
commit 0a03867352

View File

@@ -32,7 +32,7 @@ pub struct CleanupResult {
macro_rules! patch {
($lv: expr, $rv: expr, $key: tt) => {
if ($rv.$key).is_some() {
$lv.$key = $rv.$key.clone();
$lv.$key = $rv.$key.to_owned();
}
};
}