fn handle_formatted_file(
        &mut self,
        source_map: &SourceMap,
        path: FileName,
        result: String,
        report: &mut FormatReport,
    ) -> Result<(), ErrorKind> {
        if let Some(ref mut out) = self.out {
            match source_file::write_file(Some(source_map), &path, &result, out, &self.config) {
                Ok(has_diff) if has_diff => report.add_diff(),
                Err(e) => {
                    // Create a new error with path_str to help users see which files failed
                    let err_msg = format!("{}: {}", path, e);
                    return Err(io::Error::new(e.kind(), err_msg).into());
                }
                _ => {}
            }
        }

        self.source_file.push((path, result));
        Ok(())
    }
// Called for each formatted file.
Called for each formatted file.
Called for each formatted file .
fn handle_formatted_file(
        &mut self,
        source_map: &SourceMap,
        path: FileName,
        result: String,
        report: &mut FormatReport,
    ) -> Result<(), ErrorKind> {
        if let Some(ref mut out) = self.out {
            match source_file::write_file(Some(source_map), &path, &result, out, &self.config) {
                Ok(has_diff) if has_diff => report.add_diff(),
                Err(e) => {
                    // Create a new error with path_str to help users see which files failed
                    let err_msg = format!("{}: {}", path, e);
                    return Err(io::Error::new(e.kind(), err_msg).into());
                }
                _ => {}
            }
        }
        self.source_file.push((path, result));
        Ok(())
    }
fn handle_formatted_file ( & mut self , source_map : & SourceMap , path : FileName , result : String , report : & mut FormatReport , ) -> Result < ( ) , ErrorKind > { if let Some ( ref mut out ) = self . out { match source_file :: write_file ( Some ( source_map ) , & path , & result , out , & self . config ) { Ok ( has_diff ) if has_diff => report . add_diff ( ) , Err ( e ) => { // Create a new error with path_str to help users see which files failed let err_msg = format ! ( " " path e ) ; return Err ( io :: Error :: new ( e . kind ( ) , err_msg ) . into ( ) ) ; } _ => { } } } self . source_file . push ( ( path , result ) ) ; Ok ( ( ) ) }
Called for each formatted file.
Called for each formatted file .
&mut self
source_map
&SourceMap
path
FileName
result
String
report
&mut FormatReport
&mut self
source_map
&SourceMap
path
FileName
result
String
report
&mut FormatReport