Skip to content

Commit 9ffffe2

Browse files
undivisibleCopilot
andcommitted
Fix CI: clippy lints and rustdoc HTML
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 7ece958 commit 9ffffe2

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

src/bin/eq.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
//! eq install — interactive multi-select installer
66
//! eq install zig nim … — install specific compilers directly
77
//! eq build [ARGS…] — cargo build with compilers on PATH
8-
//! eq generate <HEADER> — emit Rust FFI bindings from a C header
8+
//! `eq generate <HEADER>` — emit Rust FFI bindings from a C header
99
1010
use clap::{Parser, Subcommand};
1111
use console::{style, Style, Term};
@@ -268,7 +268,7 @@ fn compiler_version(path: &Path, version_args: &[&str]) -> Option<String> {
268268
let line = text.lines().next()?.trim();
269269
// Strip a leading absolute-path token some compilers (odin) emit
270270
let line = if line.starts_with('/') || line.starts_with(r"C:\") {
271-
line.splitn(2, ' ').nth(1).unwrap_or(line).trim()
271+
line.split_once(' ').map(|x| x.1).unwrap_or(line).trim()
272272
} else {
273273
line
274274
}

src/scanner.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ impl LibraryScanner {
117117
entries
118118
.filter_map(|e| e.ok())
119119
.filter(|e| {
120-
e.path().extension().map_or(false, |ext| ext == "h")
120+
e.path().extension().is_some_and(|ext| ext == "h")
121121
&& !self.should_exclude(&e.path())
122122
})
123123
.map(|e| e.path())
@@ -169,10 +169,10 @@ impl LibraryScanner {
169169
let filename = path.file_name().and_then(|s| s.to_str()).unwrap_or("");
170170

171171
self.options.exclude_patterns.iter().any(|pattern| {
172-
if pattern.starts_with('*') {
173-
filename.ends_with(&pattern[1..])
174-
} else if pattern.ends_with('*') {
175-
filename.starts_with(&pattern[..pattern.len() - 1])
172+
if let Some(suffix) = pattern.strip_prefix('*') {
173+
filename.ends_with(suffix)
174+
} else if let Some(prefix) = pattern.strip_suffix('*') {
175+
filename.starts_with(prefix)
176176
} else {
177177
filename == pattern
178178
}
@@ -234,7 +234,7 @@ impl LibraryScanner {
234234
match generate_bindings(header, &binding_opts) {
235235
Ok(binding) => {
236236
// Use header filename to avoid duplicates
237-
let safe_name = header_stem.replace('-', "_").replace('.', "_");
237+
let safe_name = header_stem.replace(['-', '.'], "_");
238238
let output_file = output_dir.join(format!("{}.rs", safe_name));
239239

240240
fs::write(&output_file, &binding.code)

0 commit comments

Comments
 (0)