/// Insert a new source file into the collection.
Insert a new source file into the collection.
Insert a new source file into the collection .
fn insert(&mut self, source_file: SourceFile) -> SourceFileRef {
        if let Some(&index) = self.filename_map.get(&source_file.filename) {
            return SourceFileRef { index };
        } else {
            let index = self.source_files.len();
            self.filename_map
                .insert(source_file.filename.clone(), index);
            self.source_files.push(source_file);
            return SourceFileRef { index };
        }
    }
fn insert ( & mut self , source_file : SourceFile ) -> SourceFileRef { if let Some ( & index ) = self . filename_map . get ( & source_file . filename ) { return SourceFileRef { index } ; } else { let index = self . source_files . len ( ) ; self . filename_map . insert ( source_file . filename . clone ( ) , index ) ; self . source_files . push ( source_file ) ; return SourceFileRef { index } ; } }
Insert a new source file into the collection.
Insert a new source file into the collection .
&mut self
source_file
SourceFile