Skip to content

Commit e3c7ed1

Browse files
committed
chore: fix feature
1 parent cf3bd53 commit e3c7ed1

File tree

1 file changed

+15
-16
lines changed

1 file changed

+15
-16
lines changed

crates/artifacts/solc/src/sources.rs

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
use foundry_compilers_core::{
2-
error::{SolcError, SolcIoError},
3-
utils::find_case_sensitive_existing_file,
4-
};
1+
use foundry_compilers_core::error::{SolcError, SolcIoError};
52
use serde::{Deserialize, Serialize};
63
use std::{
74
collections::BTreeMap,
@@ -145,20 +142,22 @@ impl Source {
145142
Self::read(file).map_err(|err| {
146143
let exists = err.path().exists();
147144
if !exists && err.path().is_symlink() {
148-
SolcError::ResolveBadSymlink(err)
149-
} else {
150-
// This is an additional check useful on OS that have case-sensitive paths, See also <https://docs.soliditylang.org/en/v0.8.17/path-resolution.html#import-callback>
151-
if !exists {
152-
// check if there exists a file with different case
153-
if let Some(existing_file) = find_case_sensitive_existing_file(file) {
154-
SolcError::ResolveCaseSensitiveFileName { error: err, existing_file }
155-
} else {
156-
SolcError::Resolve(err)
157-
}
158-
} else {
159-
SolcError::Resolve(err)
145+
return SolcError::ResolveBadSymlink(err);
146+
}
147+
148+
// This is an additional check useful on OS that have case-sensitive paths,
149+
// see also <https://docs.soliditylang.org/en/v0.8.17/path-resolution.html#import-callback>
150+
// check if there exists a file with different case
151+
#[cfg(feature = "walkdir")]
152+
if !exists {
153+
if let Some(existing_file) =
154+
foundry_compilers_core::utils::find_case_sensitive_existing_file(file)
155+
{
156+
return SolcError::ResolveCaseSensitiveFileName { error: err, existing_file };
160157
}
161158
}
159+
160+
SolcError::Resolve(err)
162161
})
163162
}
164163

0 commit comments

Comments
 (0)