Skip to content

Commit 1ec1de1

Browse files
committed
Move use statement to where the type is used
1 parent 3ef8781 commit 1ec1de1

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

asyncgit/src/sync/diff.rs

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -346,11 +346,6 @@ pub fn get_diff(
346346
stage: bool,
347347
options: Option<DiffOptions>,
348348
) -> Result<FileDiff> {
349-
// TODO:
350-
// Maybe move this `use` statement` closer to where it is being used by extracting the relevant
351-
// code into a function.
352-
use gix::diff::blob::platform::prepare_diff::Operation;
353-
354349
scope_time!("get_diff");
355350

356351
let mut gix_repo = gix_repo(repo_path)?;
@@ -404,13 +399,17 @@ pub fn get_diff(
404399

405400
let outcome = resource_cache.prepare_diff()?;
406401

407-
let diff_algorithm = match outcome.operation {
408-
Operation::InternalDiff { algorithm } => algorithm,
409-
Operation::ExternalCommand { .. } => {
410-
unreachable!("We disabled that")
411-
}
412-
Operation::SourceOrDestinationIsBinary => {
413-
todo!();
402+
let diff_algorithm = {
403+
use gix::diff::blob::platform::prepare_diff::Operation;
404+
405+
match outcome.operation {
406+
Operation::InternalDiff { algorithm } => algorithm,
407+
Operation::ExternalCommand { .. } => {
408+
unreachable!("We disabled that")
409+
}
410+
Operation::SourceOrDestinationIsBinary => {
411+
todo!();
412+
}
414413
}
415414
};
416415

0 commit comments

Comments
 (0)