mirror of
https://github.com/sharkdp/bat
synced 2026-07-24 17:13:19 +00:00
Add *_with_name methods
This commit is contained in:
+2
-1
@@ -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>> {
|
||||
|
||||
Reference in New Issue
Block a user