debian_analyzer::editor

Function tree_edit_formatted_file

Source
pub fn tree_edit_formatted_file(
    tree: &dyn MutableTree,
    path: &Path,
    original_contents: Option<&[u8]>,
    rewritten_contents: Option<&[u8]>,
    updated_contents: Option<&[u8]>,
    allow_generated: bool,
    allow_reformatting: bool,
) -> Result<bool, EditorError>
Expand description

Edit a formatted file in a tree.

§Arguments

  • tree - The tree to edit
  • path - Path to the file
  • original_contents - The original contents of the file
  • rewritten_contents - The contents rewritten with our parser/serializer
  • updated_contents - Updated contents rewritten with our parser/serializer after changes were made
  • allow_generated - Do not raise GeneratedFile when encountering a generated file
  • allow_reformatting - Whether to allow reformatting of the file

§Returns

true if the file was changed, false otherwise