Skip to content

Commit 9343f41

Browse files
committed
refactor linker name extraction to improve clarity and avoid false positives
1 parent 9c7f702 commit 9343f41

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

aimdb-embassy-adapter/build.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ fn main() {
3939
// Check for GNU ld specifically, avoiding false positives with lld or paths containing 'ld'
4040
let linker_name = linker
4141
.split('/')
42-
.last()
42+
.next_back()
4343
.unwrap_or(&linker)
4444
.split('\\')
45-
.last()
45+
.next_back()
4646
.unwrap_or(&linker);
4747

4848
if linker_name == "ld" || linker_name.starts_with("arm-") && linker_name.ends_with("-ld") {

0 commit comments

Comments
 (0)