diff options
author | Teddy Wing | 2020-07-25 16:57:23 +0200 |
---|---|---|
committer | Teddy Wing | 2020-07-25 16:57:23 +0200 |
commit | d97f26047d8353ef3372bacde2a1e233c4f2a2d8 (patch) | |
tree | f26f1a3f650e6c565cc3ca5a60181ca41384a397 /src | |
parent | fe0290e043cdaa533c071aa62eb922b4cf105625 (diff) | |
download | git-suggestion-d97f26047d8353ef3372bacde2a1e233c4f2a2d8.tar.bz2 |
Suggestion: Rename `suggestion` field to `comment`
The name "suggestion" sounds like the suggested diff change, when really
this field will be deserialised with the whole GitHub comment, including
adjacent text as well as the suggestion.
Diffstat (limited to 'src')
-rw-r--r-- | src/lib.rs | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -66,7 +66,7 @@ pub struct Suggestion { diff: String, #[serde(rename = "body")] - suggestion: String, + comment: String, path: String, @@ -98,7 +98,7 @@ impl Suggestion { fn suggestion(&self) -> String { let re = Regex::new(r"(?s).*(?-s)```\s*suggestion.*\n").unwrap(); - let s = re.replace(&self.suggestion, "+"); + let s = re.replace(&self.comment, "+"); s.replace("```", "") } @@ -172,7 +172,7 @@ mod tests { "fmt" "io" + "os" // used to input comment"#.to_owned(), - suggestion: r#"It's ok to leave these uncommented + comment: r#"It's ok to leave these uncommented ```suggestion "os" |