Use trim_tries to extract post comment over simple trim_matches

This commit is contained in:
Seiichi Uchida 2018-08-31 18:16:50 +09:00
parent 612f1af734
commit 9df1dbe1ac

View File

@ -288,9 +288,9 @@ impl Chain {
return;
}
// HACK: Treat `?`s as separators.
let trimmed_snippet = post_comment_snippet.trim_matches('?');
let comment_end = get_comment_end(trimmed_snippet, "?", "", false);
let maybe_post_comment = extract_post_comment(trimmed_snippet, comment_end, "?")
let trimmed_snippet = trim_tries(post_comment_snippet);
let comment_end = get_comment_end(&trimmed_snippet, "?", "", false);
let maybe_post_comment = extract_post_comment(&trimmed_snippet, comment_end, "?")
.and_then(|comment| {
if comment.is_empty() {
None