Skip to main content

FileFixer

Trait FileFixer 

Source
pub trait FileFixer {
    // Required method
    fn fix_files<'a>(
        &mut self,
        store: &Store,
        files_to_fix: &'a HashSet<FileToFix>,
    ) -> Result<HashMap<&'a FileToFix, FileId>, FixError>;
}
Expand description

Fixes a set of files.

Fixing a file is implementation dependent. For example it may format source code using a code formatter.

Required Methods§

Source

fn fix_files<'a>( &mut self, store: &Store, files_to_fix: &'a HashSet<FileToFix>, ) -> Result<HashMap<&'a FileToFix, FileId>, FixError>

Fixes a set of files. Stores the resulting file content (for modified files).

Returns a map describing the subset of files_to_fix that resulted in changed file content (unchanged files should not be present in the map), pointing to the new FileId for the file.

TODO: Better error handling so we can tell the user what went wrong with each failed input.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§