Browse Source

Update assert and adjust docs

cmd
James Higgs 8 years ago
parent
commit
f8fcfe1f2b
  1. 11
      src/lib.rs

11
src/lib.rs

@ -611,14 +611,13 @@ impl Config {
/// This is only relevant for C and C++ files. /// This is only relevant for C and C++ files.
/// ///
/// # Panics /// # Panics
/// Panics if more than one file is present in the config, as macro /// Panics if more than one file is present in the config.
/// expansion only makes sense for a single file.
/// ///
/// # Example /// # Example
/// ```no_run /// ```no_run
/// let out = gcc::Config::new() /// let out = gcc::Config::new()
/// .file("src/foo.c") /// .file("src/foo.c")
/// .expand(); /// .expand();
/// ``` /// ```
pub fn expand(&self) -> Vec<u8> { pub fn expand(&self) -> Vec<u8> {
let compiler = self.get_compiler(); let compiler = self.get_compiler();
@ -628,8 +627,8 @@ impl Config {
} }
cmd.arg(compiler.family.expand_flag()); cmd.arg(compiler.family.expand_flag());
assert_eq!(self.files.len(), 1, assert!(self.files.len() <= 1,
"Expand may only be called for a single file"); "Expand may only be called for a single file");
for file in self.files.iter() { for file in self.files.iter() {
cmd.arg(file); cmd.arg(file);

Loading…
Cancel
Save