From 06d31f314ef9f1546ef70e9f1d082c4f1fd49cdf Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Thu, 16 Jul 2026 23:45:03 +0800 Subject: feat(picker): add with_route method to change phantom route type --- mingling_picker/src/picker.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/mingling_picker/src/picker.rs b/mingling_picker/src/picker.rs index 4473d76..4efb532 100644 --- a/mingling_picker/src/picker.rs +++ b/mingling_picker/src/picker.rs @@ -47,6 +47,22 @@ impl<'a> Picker<'a> { args: PickerArgs::Owned(args), } } + + /// Changes the route (phantom type parameter) of the `Picker`. + /// + /// This method allows converting a `Picker` from one route type to another, + /// while preserving the same underlying arguments. The route type is typically + /// used to distinguish different parsing contexts or to carry compile-time + /// state information through the picking chain. + pub fn with_route(self) -> Picker<'a, NewRoute> + where + Self: Sized, + { + Picker { + route_phantom: PhantomData, + args: self.args, + } + } } /// Internal arguments of Picker -- cgit