diff options
author | David Peter <mail@david-peter.de> | 2021-03-07 14:41:52 +0100 |
---|---|---|
committer | David Peter <sharkdp@users.noreply.github.com> | 2021-03-07 14:59:10 +0100 |
commit | 2e7f2b6c0709d758e4e92e5b9cab134d8d04b931 (patch) | |
tree | 6e84fc3c69e4692a0be78135190862a60e5f2161 | |
parent | 35347c23109400e9694f073bf8fe901b3ca1d59f (diff) |
'mut self' => 'self', remove pub
-rw-r--r-- | src/input.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/input.rs b/src/input.rs index f31b404b..0eb670b0 100644 --- a/src/input.rs +++ b/src/input.rs @@ -112,6 +112,7 @@ impl<'a> Input<'a> { pub fn ordinary_file(path: impl AsRef<Path>) -> Self { Self::_ordinary_file(path.as_ref()) } + fn _ordinary_file(path: &Path) -> Self { let kind = InputKind::OrdinaryFile(path.to_path_buf()); Input { @@ -143,10 +144,11 @@ impl<'a> Input<'a> { matches!(self.kind, InputKind::StdIn) } - pub fn with_name(mut self, provided_name: Option<impl AsRef<Path>>) -> Self { + pub fn with_name(self, provided_name: Option<impl AsRef<Path>>) -> Self { self._with_name(provided_name.as_ref().map(|it| it.as_ref())) } - pub fn _with_name(mut self, provided_name: Option<&Path>) -> Self { + + fn _with_name(mut self, provided_name: Option<&Path>) -> Self { if let Some(name) = provided_name { self.description.name = name.to_string_lossy().to_string() } |