Skip to content

Commit 859488b

Browse files
committed
pagination: Clone values between variant structs
This allows us to use `String` in seek variants. The `.clone()` call isn't ideal, and shouldn't be necessary, but rewriting the `seek!()` macro was out of scope for this effort.
1 parent b402c58 commit 859488b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/controllers/helpers/pagination.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ macro_rules! seek {
461461
impl From<[<$variant Helper>]> for $variant {
462462
fn from(helper: [<$variant Helper>]) -> Self {
463463
let [<$variant Helper>]($($field,)*) = helper;
464-
Self { $($field,)* }
464+
Self { $($field: $field.clone(),)* }
465465
}
466466
}
467467

@@ -470,7 +470,7 @@ macro_rules! seek {
470470
where
471471
S: serde::Serializer,
472472
{
473-
let helper = [<$variant Helper>]($(self.$field,)*);
473+
let helper = [<$variant Helper>]($(self.$field.clone(),)*);
474474
serde::Serialize::serialize(&helper, serializer)
475475
}
476476
}

0 commit comments

Comments
 (0)