File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ use anyhow::Context as _;
44use anyhow:: bail;
55
66use super :: Context ;
7+ use crate :: interactions:: ErrorComment ;
78use crate :: {
89 config:: Config ,
910 db:: issue_data:: IssueData ,
@@ -157,7 +158,8 @@ async fn handle_new_state(
157158 }
158159
159160 for error_to_add in errors_to_add {
160- let comment = event. issue . post_comment ( & ctx. github , & error_to_add) . await ?;
161+ let error_comment = ErrorComment :: new ( & event. issue , & error_to_add) ;
162+ let comment = error_comment. post ( & ctx. github ) . await ?;
161163 state. data . last_errors . push ( ( error_to_add, comment. node_id ) ) ;
162164 }
163165 }
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ use tokio_postgres::Client as DbClient;
44
55use crate :: {
66 db:: issue_data:: IssueData ,
7- github:: { GithubClient , Issue } ,
7+ github:: { Comment , GithubClient , Issue } ,
88} ;
99use std:: fmt:: Write ;
1010
@@ -24,7 +24,7 @@ impl<'a> ErrorComment<'a> {
2424 }
2525 }
2626
27- pub async fn post ( & self , client : & GithubClient ) -> anyhow:: Result < ( ) > {
27+ pub async fn post ( & self , client : & GithubClient ) -> anyhow:: Result < Comment > {
2828 let mut body = String :: new ( ) ;
2929 writeln ! ( body, "**Error**: {}" , self . message) ?;
3030 writeln ! ( body) ?;
@@ -33,8 +33,7 @@ impl<'a> ErrorComment<'a> {
3333 "Please file an issue on GitHub at [triagebot](https://github.com/rust-lang/triagebot) if there's \
3434 a problem with this bot, or reach out on [#t-infra](https://rust-lang.zulipchat.com/#narrow/stream/242791-t-infra) on Zulip."
3535 ) ?;
36- self . issue . post_comment ( client, & body) . await ?;
37- Ok ( ( ) )
36+ self . issue . post_comment ( client, & body) . await
3837 }
3938}
4039
You can’t perform that action at this time.
0 commit comments