Skip to content

Commit 77fbe22

Browse files
kino-matwistedfall
authored andcommitted
fix: return an error when the parsing has failed
1 parent c5bfa08 commit 77fbe22

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

build/library.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,14 +226,14 @@ impl Library {
226226
let mut cargo_metadata = Vec::with_capacity(64);
227227
let include_paths: Vec<_> = include_paths.iter().map(PathBuf::from).collect();
228228

229-
let version = Self::version_from_include_paths(&include_paths);
229+
let version = Self::version_from_include_paths(&include_paths).ok_or("could not get versions from header files")?;
230230

231231
cargo_metadata.extend(Self::process_link_paths(Some(link_paths), vec![], None));
232232
cargo_metadata.extend(Self::process_link_libs(Some(link_libs), vec![], None));
233233

234234
Ok(Self {
235235
include_paths,
236-
version: version.unwrap_or_else(|| Version::new(0, 0, 0)),
236+
version,
237237
cargo_metadata,
238238
})
239239
} else {

0 commit comments

Comments
 (0)