aboutsummaryrefslogtreecommitdiff
path: root/mingling_picker/src/picker.rs
diff options
context:
space:
mode:
Diffstat (limited to 'mingling_picker/src/picker.rs')
-rw-r--r--mingling_picker/src/picker.rs14
1 files changed, 12 insertions, 2 deletions
diff --git a/mingling_picker/src/picker.rs b/mingling_picker/src/picker.rs
index 69b1671..81fb10a 100644
--- a/mingling_picker/src/picker.rs
+++ b/mingling_picker/src/picker.rs
@@ -12,10 +12,10 @@ use crate::{Pickable, PickerArg, PickerArgResult};
#[doc = include_str!("../README.md")]
pub struct Picker<'a, Route = ()> {
- route_phantom: PhantomData<Route>,
+ pub(crate) route_phantom: PhantomData<Route>,
/// Internal arguments of Picker
- args: PickerArgs<'a>,
+ pub(crate) args: PickerArgs<'a>,
}
impl<'a> Picker<'a> {
@@ -344,6 +344,16 @@ impl<'a> IntoPicker<'a> for Vec<&'a str> {
}
}
+impl<'a> IntoPicker<'a> for &'a Vec<String> {
+ fn to_picker(self) -> Picker<'a, ()> {
+ let slice: Vec<&str> = self.iter().map(|s| s.as_str()).collect();
+ Picker {
+ route_phantom: PhantomData,
+ args: PickerArgs::Vec(slice),
+ }
+ }
+}
+
impl<'a> IntoPicker<'a> for Vec<String> {
fn to_picker(self) -> Picker<'a, ()> {
Picker {