Skip to content

Commit f8fcfe1

Browse files
committed
Update assert and adjust docs
1 parent 92d0b57 commit f8fcfe1

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/lib.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -611,14 +611,13 @@ impl Config {
611611
/// This is only relevant for C and C++ files.
612612
///
613613
/// # Panics
614-
/// Panics if more than one file is present in the config, as macro
615-
/// expansion only makes sense for a single file.
614+
/// Panics if more than one file is present in the config.
616615
///
617616
/// # Example
618617
/// ```no_run
619618
/// let out = gcc::Config::new()
620-
/// .file("src/foo.c")
621-
/// .expand();
619+
/// .file("src/foo.c")
620+
/// .expand();
622621
/// ```
623622
pub fn expand(&self) -> Vec<u8> {
624623
let compiler = self.get_compiler();
@@ -628,8 +627,8 @@ impl Config {
628627
}
629628
cmd.arg(compiler.family.expand_flag());
630629

631-
assert_eq!(self.files.len(), 1,
632-
"Expand may only be called for a single file");
630+
assert!(self.files.len() <= 1,
631+
"Expand may only be called for a single file");
633632

634633
for file in self.files.iter() {
635634
cmd.arg(file);

0 commit comments

Comments
 (0)