Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a files method #199

Closed
brson opened this issue Jul 13, 2017 · 4 comments
Closed

Add a files method #199

brson opened this issue Jul 13, 2017 · 4 comments

Comments

@brson
Copy link
Contributor

brson commented Jul 13, 2017

Like file but takes multiple files. Make it accept IntoIterator<Item = AsRef<&str>>.

@opilar
Copy link
Contributor

opilar commented Jul 13, 2017

@brson maybe IntoIterator<Item = AsRef<Path>>? file takes AsRef<Path>.

@alexcrichton
Copy link
Member

@opilar yeah that sounds right to me!

@opilar
Copy link
Contributor

opilar commented Jul 13, 2017

Can anyone help me with that?

258 | /     pub fn files<P: IntoIterator<Item = AsRef<Path>>>(&mut self, p: P) -> &mut Config {
259 | |         for file in p.into_iter() {
260 | |             self.file(file);
261 | |         }
262 | |         self
263 | |     }
    | |_____^ `std::convert::AsRef<std::path::Path> + 'static` does not have a constant size known at compile-time
    |
    = help: the trait `std::marker::Sized` is not implemented for `std::convert::AsRef<std::path::Path> + 'static`
    = note: required by `std::iter::IntoIterator`

@alexcrichton
Copy link
Member

Oh that's actually shorthand, I think what you'll actually want is:

fn files<P>(...)
    where P: IntoIterator, P::Item: AsRef<Path>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants