@@ -66,47 +66,49 @@ pub async fn handle_compile_detail_sections(
66
66
) -> ServerResult < detail_sections:: Response > {
67
67
log:: info!( "handle_compile_detail_sections({:?})" , request) ;
68
68
69
- let artifact_ids = Arc :: new ( master_artifact_ids_for_range (
70
- & ctxt,
71
- request. start ,
72
- request. end ,
73
- ) ) ;
69
+ let start_artifact = ctxt
70
+ . artifact_id_for_bound ( request. start . clone ( ) , true )
71
+ . ok_or ( format ! (
72
+ "could not find start commit for bound {:?}" ,
73
+ request. start
74
+ ) ) ?;
75
+ let end_artifact = ctxt
76
+ . artifact_id_for_bound ( request. end . clone ( ) , false )
77
+ . ok_or ( format ! (
78
+ "could not find end commit for bound {:?}" ,
79
+ request. end
80
+ ) ) ?;
74
81
75
82
let scenario = request. scenario . parse ( ) ?;
76
83
77
84
async fn calculate_sections (
78
85
ctxt : & SiteCtxt ,
79
- aid : Option < & ArtifactId > ,
86
+ aid : ArtifactId ,
80
87
benchmark : & str ,
81
88
profile : & str ,
82
89
scenario : Scenario ,
83
90
) -> Option < CompilationSections > {
84
- match aid {
85
- Some ( aid) => {
86
- get_or_download_self_profile ( ctxt, aid. clone ( ) , benchmark, profile, scenario, None )
87
- . await
88
- . ok ( )
89
- . map ( |profile| CompilationSections {
90
- sections : profile. compilation_sections ,
91
- } )
92
- }
93
- None => None ,
94
- }
91
+ get_or_download_self_profile ( ctxt, aid, benchmark, profile, scenario, None )
92
+ . await
93
+ . ok ( )
94
+ . map ( |profile| CompilationSections {
95
+ sections : profile. compilation_sections ,
96
+ } )
95
97
}
96
98
97
99
// Doc queries are not split into the classic frontend/backend/linker parts.
98
100
let ( before, after) = if request. profile != "doc" {
99
101
tokio:: join!(
100
102
calculate_sections(
101
103
& ctxt,
102
- artifact_ids . get ( 0 ) ,
104
+ start_artifact ,
103
105
& request. benchmark,
104
106
& request. profile,
105
107
scenario,
106
108
) ,
107
109
calculate_sections(
108
110
& ctxt,
109
- artifact_ids . get ( 1 ) ,
111
+ end_artifact ,
110
112
& request. benchmark,
111
113
& request. profile,
112
114
scenario,
0 commit comments