diff -r 80840b651721 -r 5ce2aa7c2ad5 rust/hg-core/src/repo.rs --- a/rust/hg-core/src/repo.rs Mon Feb 15 20:05:32 2021 +0100 +++ b/rust/hg-core/src/repo.rs Mon Feb 15 20:13:09 2021 +0100 @@ -81,28 +81,6 @@ } } - /// Like `Repo::find`, but not finding a repository is not an error if no - /// explicit path is given. `Ok(None)` is returned in that case. - /// - /// If an explicit path *is* given, not finding a repository there is still - /// an error. - /// - /// For sub-commands that don’t need a repository, configuration should - /// still be affected by a repository’s `.hg/hgrc` file. This is the - /// constructor to use. - pub fn find_optional( - config: &Config, - explicit_path: Option<&Path>, - ) -> Result, RepoError> { - match Self::find(config, explicit_path) { - Ok(repo) => Ok(Some(repo)), - Err(RepoError::NotFound { .. }) if explicit_path.is_none() => { - Ok(None) - } - Err(error) => Err(error), - } - } - /// To be called after checking that `.hg` is a sub-directory fn new_at_path( working_directory: PathBuf,