Skip to content

Commit 9c0296d

Browse files
committed
DRY
1 parent c3d1451 commit 9c0296d

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

src/ownership.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ pub(crate) mod codeowners_file_parser;
1313
pub(crate) mod codeowners_query;
1414
mod file_generator;
1515
mod file_owner_finder;
16-
pub mod for_file_fast;
16+
pub mod file_owner_resolver;
1717
pub(crate) mod mapper;
1818
mod validator;
1919

src/runner.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ impl Runner {
176176
}
177177

178178
pub fn owners_for_file(&self, file_path: &str) -> Result<Vec<FileOwner>, Error> {
179-
use crate::ownership::for_file_fast::find_file_owners;
179+
use crate::ownership::file_owner_resolver::find_file_owners;
180180
let owners = find_file_owners(&self.run_config.project_root, &self.config, std::path::Path::new(file_path)).map_err(Error::Io)?;
181181
Ok(owners)
182182
}
@@ -215,10 +215,7 @@ impl Runner {
215215
pub fn for_file_codeowners_only(&self, file_path: &str) -> RunResult {
216216
match team_for_file_from_codeowners(&self.run_config, file_path) {
217217
Ok(Some(team)) => {
218-
let relative_team_path = team
219-
.path
220-
.strip_prefix(&self.run_config.project_root)
221-
.unwrap_or(team.path.as_path())
218+
let relative_team_path = crate::path_utils::relative_to(&self.run_config.project_root, team.path.as_path())
222219
.to_string_lossy()
223220
.to_string();
224221
RunResult {

0 commit comments

Comments
 (0)