Add *_with_name methods

This commit is contained in:
sharkdp authored and David Peter committed 2020-04-22 23:55:28 +02:00
1 parent 53a973e9dd
commit 261a7ea154
5 files changed
+37 -13

No files matched your search

+2 -1
View File
@@ -82,8 +82,9 @@ impl<'a> Input<'a> {
}
}
pub fn set_provided_name(&mut self, provided_name: Option<&OsStr>) {
pub fn with_name(mut self, provided_name: Option<&OsStr>) -> Self {
self.metadata.user_provided_name = provided_name.map(|n| n.to_owned());
self
}
pub(crate) fn open<R: BufRead + 'a>(self, stdin: R) -> Result<OpenedInput<'a>> {