File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
crates/rust-project-goals-cli/src Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -295,8 +295,14 @@ fn initialize_issues<'doc>(
295
295
//
296
296
let existing_issue = if let Some ( tracking_issue) = desired_issue. tracking_issue {
297
297
// a. We first check if there is a declared tracking issue in the markdown file.
298
- // If so, then we just load its information from the repository by number.
299
- Some ( fetch_issue ( repository, tracking_issue. number ) ?)
298
+ // If so, check if we've already loaded its data.
299
+ if let Some ( issue) = milestone_issues. iter ( ) . find ( |issue| issue. number == tracking_issue. number ) {
300
+ // If so, reuse it to avoid latency.
301
+ Some ( issue. clone ( ) )
302
+ } else {
303
+ // If not, load its information from the repository by number.
304
+ Some ( fetch_issue ( repository, tracking_issue. number ) ?)
305
+ }
300
306
} else {
301
307
// b. If the markdown does not have a declared tracking issue, then we can search through
302
308
// the issues in the milestone for one with the correct title.
@@ -357,7 +363,7 @@ fn initialize_issues<'doc>(
357
363
if !existing_issue. body . contains ( & link_text) {
358
364
actions. insert ( GithubAction :: UpdateIssueBody {
359
365
number : existing_issue. number ,
360
- body : existing_issue . body ,
366
+ body : desired_issue . body ,
361
367
} ) ;
362
368
}
363
369
You can’t perform that action at this time.
0 commit comments