diff options
author | Teddy Wing | 2020-07-25 18:38:10 +0200 |
---|---|---|
committer | Teddy Wing | 2020-07-25 18:38:10 +0200 |
commit | 4acd5cbce9945ef044dc997cb82cfad8273a0dbc (patch) | |
tree | 909aaf4615d08f1cadb299d5876dfa11a16a0c0b /src/lib.rs | |
parent | a22f7a574cbbad22ed637405bafee42593eab87b (diff) | |
download | git-suggestion-4acd5cbce9945ef044dc997cb82cfad8273a0dbc.tar.bz2 |
Add git-sugapply bin
An executable to apply a suggested change to the appropriate file in the
repo.
Add a new `SuggestionUrl` type that allows us to extract the necessary
data to fetch a suggestion comment from the GitHub API using a GitHub
pull request comment URL.
Diffstat (limited to 'src/lib.rs')
-rw-r--r-- | src/lib.rs | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -1,6 +1,11 @@ #![warn(rust_2018_idioms)] +mod url; + +pub use crate::url::SuggestionUrl; + + use std::fs; use std::fs::{File, OpenOptions}; use std::io::{BufRead, BufReader, Write}; @@ -109,7 +114,7 @@ impl Suggestion { s.replace("```", "") } - fn apply(&self) -> Result<(), Error> { + pub fn apply(&self) -> Result<(), Error> { let repo = Repository::open(".").unwrap(); let repo_root = repo.workdir().unwrap(); |