comparison rust/hg-core/src/repo.rs @ 46442:02d3bb972121

rust: replace RequirementsError with HgError Differential Revision: https://phab.mercurial-scm.org/D9896
author Simon Sapin <simon.sapin@octobus.net>
date Wed, 27 Jan 2021 14:59:09 +0100
parents 8a4914397d02
children 43d63979a75e
comparison
equal deleted inserted replaced
46441:741e36f472a5 46442:02d3bb972121
1 use crate::errors::HgError;
1 use crate::operations::{find_root, FindRootError}; 2 use crate::operations::{find_root, FindRootError};
2 use crate::requirements; 3 use crate::requirements;
3 use memmap::{Mmap, MmapOptions}; 4 use memmap::{Mmap, MmapOptions};
4 use std::path::{Path, PathBuf}; 5 use std::path::{Path, PathBuf};
5 6
31 32
32 pub fn find() -> Result<Self, FindRootError> { 33 pub fn find() -> Result<Self, FindRootError> {
33 find_root().map(Self::for_path) 34 find_root().map(Self::for_path)
34 } 35 }
35 36
36 pub fn check_requirements( 37 pub fn check_requirements(&self) -> Result<(), HgError> {
37 &self,
38 ) -> Result<(), requirements::RequirementsError> {
39 requirements::check(self) 38 requirements::check(self)
40 } 39 }
41 40
42 pub fn working_directory_path(&self) -> &Path { 41 pub fn working_directory_path(&self) -> &Path {
43 &self.working_directory 42 &self.working_directory