pub fn push<S: AsRef<OsStr> + ?Sized>(&mut self, file: &S) -> Result<usize> {
        let e = CompilationUnit::from_file(Path::new(file))?;
        if self.contains(&e) {
            Err(format!(
                "Cyclic dependency detected: {} -> {}",
                self.elements
                    .iter()
                    .map(ToString::to_string)
                    .collect::<Vec<String>>()
                    .join(" -> "),
                e.to_string()
            )
            .into())
        } else {
            let cu = self.cus.len();
            self.cus.push(e.clone());
            self.elements.push(e);
            Ok(cu)
        }
    }
/// Pushes a a compilation unit onto the include stack
Pushes a a compilation unit onto the include stack
Pushes a a compilation unit onto the include stack
pub fn push<S: AsRef<OsStr> + ?Sized>(&mut self, file: &S) -> Result<usize> {
        let e = CompilationUnit::from_file(Path::new(file))?;
        if self.contains(&e) {
            Err(format!(
                "Cyclic dependency detected: {} -> {}",
                self.elements
                    .iter()
                    .map(ToString::to_string)
                    .collect::<Vec<String>>()
                    .join(" -> "),
                e.to_string()
            )
            .into())
        } else {
            let cu = self.cus.len();
            self.cus.push(e.clone());
            self.elements.push(e);
            Ok(cu)
        }
    }
pub fn push < S : AsRef < OsStr > + ? Sized > ( & mut self , file : & S ) -> Result < usize > { let e = CompilationUnit :: from_file ( Path :: new ( file ) ) ? ; if self . contains ( & e ) { Err ( format ! ( " " self elements iter ( ) map ( ToString to_string ) collect Vec String ( ) join ( " " ) e to_string ( ) ) . into ( ) ) } else { let cu = self . cus . len ( ) ; self . cus . push ( e . clone ( ) ) ; self . elements . push ( e ) ; Ok ( cu ) } }
Pushes a a compilation unit onto the include stack
Pushes a a compilation unit onto the include stack
&mut self
file
&S
&mut self
file
&S