From d27d99084b58d19dc76443a03a0db445cbd9bcc7 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Sat, 25 Jul 2020 13:22:04 +0200 Subject: Suggestion: Try applying a change to the file (WIP) Not working yet, but the idea is to get the file referenced by the suggestion and apply the suggested change directly to it. Here, we read the original file, and write its contents to the new file, replacing the lines modified by the suggestion with the suggested change. Currently doesn't work because you can't pass file instances to `fs::rename`, only paths. I'd like to try a slightly different system so I can keep the original file's creation date. With the current system, it would be overwritten by the new temporary file created to store the change. --- Cargo.toml | 1 + 1 file changed, 1 insertion(+) (limited to 'Cargo.toml') diff --git a/Cargo.toml b/Cargo.toml index 8fb2e65..7f5a472 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,5 +9,6 @@ github-rs = "0.7.0" regex = "1.3.9" serde = { version = "1.0.114", features = ["derive"] } serde_json = "1.0.56" +tempfile = "3.1.0" thiserror = "1.0.20" unidiff = "0.3.3" -- cgit v1.2.3