Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- trait Store<I> where I: for<'a> IntoIterator<Item = &'a str> {
- fn query_valid_paths(&mut self, iter: I) -> Vec<String>;
- }
- struct Bar<I> { vec: Vec<Box<dyn Store<I>>> }
- struct Foo {}
- impl<I> Store<I> for Foo where I: for<'a> IntoIterator<Item = &'a str> {
- fn query_valid_paths(&mut self, iter: I) -> Vec<String> {
- iter.into_iter().map(|x| x.to_string()).collect()
- }
- }
- fn main() {
- let something = "Something";
- let mut foo = Foo {};
- //println!("{:?}", foo.query_valid_paths(something.iter()));
- }
Add Comment
Please, Sign In to add comment