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 _;
4
4
use anyhow:: bail;
5
5
6
6
use super :: Context ;
7
+ use crate :: interactions:: ErrorComment ;
7
8
use crate :: {
8
9
config:: Config ,
9
10
db:: issue_data:: IssueData ,
@@ -157,7 +158,8 @@ async fn handle_new_state(
157
158
}
158
159
159
160
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 ?;
161
163
state. data . last_errors . push ( ( error_to_add, comment. node_id ) ) ;
162
164
}
163
165
}
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ use tokio_postgres::Client as DbClient;
4
4
5
5
use crate :: {
6
6
db:: issue_data:: IssueData ,
7
- github:: { GithubClient , Issue } ,
7
+ github:: { Comment , GithubClient , Issue } ,
8
8
} ;
9
9
use std:: fmt:: Write ;
10
10
@@ -24,7 +24,7 @@ impl<'a> ErrorComment<'a> {
24
24
}
25
25
}
26
26
27
- pub async fn post ( & self , client : & GithubClient ) -> anyhow:: Result < ( ) > {
27
+ pub async fn post ( & self , client : & GithubClient ) -> anyhow:: Result < Comment > {
28
28
let mut body = String :: new ( ) ;
29
29
writeln ! ( body, "**Error**: {}" , self . message) ?;
30
30
writeln ! ( body) ?;
@@ -33,8 +33,7 @@ impl<'a> ErrorComment<'a> {
33
33
"Please file an issue on GitHub at [triagebot](https://github.com/rust-lang/triagebot) if there's \
34
34
a problem with this bot, or reach out on [#t-infra](https://rust-lang.zulipchat.com/#narrow/stream/242791-t-infra) on Zulip."
35
35
) ?;
36
- self . issue . post_comment ( client, & body) . await ?;
37
- Ok ( ( ) )
36
+ self . issue . post_comment ( client, & body) . await
38
37
}
39
38
}
40
39
You can’t perform that action at this time.
0 commit comments