File tree 4 files changed +9
-24
lines changed
4 files changed +9
-24
lines changed Original file line number Diff line number Diff line change @@ -85,16 +85,13 @@ fn main() {
85
85
86
86
let mut artifact_path = None ;
87
87
for message in Message :: parse_stream ( output. stdout . as_slice ( ) ) {
88
- match message. unwrap ( ) {
89
- Message :: CompilerArtifact ( artifact) => {
90
- if artifact. target . kind . contains ( & "proc-macro" . to_string ( ) ) {
91
- let repr = format ! ( "{} {}" , name, version) ;
92
- if artifact. package_id . repr . starts_with ( & repr) {
93
- artifact_path = Some ( PathBuf :: from ( & artifact. filenames [ 0 ] ) ) ;
94
- }
88
+ if let Message :: CompilerArtifact ( artifact) = message. unwrap ( ) {
89
+ if artifact. target . kind . contains ( & "proc-macro" . to_string ( ) ) {
90
+ let repr = format ! ( "{} {}" , name, version) ;
91
+ if artifact. package_id . repr . starts_with ( & repr) {
92
+ artifact_path = Some ( PathBuf :: from ( & artifact. filenames [ 0 ] ) ) ;
95
93
}
96
94
}
97
- _ => ( ) , // Unknown message
98
95
}
99
96
}
100
97
Original file line number Diff line number Diff line change @@ -140,16 +140,11 @@ impl FileSetConfig {
140
140
}
141
141
142
142
/// Builder for [`FileSetConfig`].
143
+ #[ derive( Default ) ]
143
144
pub struct FileSetConfigBuilder {
144
145
roots : Vec < Vec < VfsPath > > ,
145
146
}
146
147
147
- impl Default for FileSetConfigBuilder {
148
- fn default ( ) -> Self {
149
- FileSetConfigBuilder { roots : Vec :: new ( ) }
150
- }
151
- }
152
-
153
148
impl FileSetConfigBuilder {
154
149
/// Returns the number of sets currently held.
155
150
pub fn len ( & self ) -> usize {
Original file line number Diff line number Diff line change @@ -9,16 +9,11 @@ use rustc_hash::FxHasher;
9
9
use crate :: { FileId , VfsPath } ;
10
10
11
11
/// Structure to map between [`VfsPath`] and [`FileId`].
12
+ #[ derive( Default ) ]
12
13
pub ( crate ) struct PathInterner {
13
14
map : IndexSet < VfsPath , BuildHasherDefault < FxHasher > > ,
14
15
}
15
16
16
- impl Default for PathInterner {
17
- fn default ( ) -> Self {
18
- Self { map : IndexSet :: default ( ) }
19
- }
20
- }
21
-
22
17
impl PathInterner {
23
18
/// Get the id corresponding to `path`.
24
19
///
Original file line number Diff line number Diff line change @@ -113,11 +113,9 @@ fn unescape(s: &str) -> String {
113
113
fn parse_pr_number ( s : & str ) -> Option < u32 > {
114
114
const BORS_PREFIX : & str = "Merge #" ;
115
115
const HOMU_PREFIX : & str = "Auto merge of #" ;
116
- if s. starts_with ( BORS_PREFIX ) {
117
- let s = & s[ BORS_PREFIX . len ( ) ..] ;
116
+ if let Some ( s) = s. strip_prefix ( BORS_PREFIX ) {
118
117
s. parse ( ) . ok ( )
119
- } else if s. starts_with ( HOMU_PREFIX ) {
120
- let s = & s[ HOMU_PREFIX . len ( ) ..] ;
118
+ } else if let Some ( s) = s. strip_prefix ( HOMU_PREFIX ) {
121
119
if let Some ( space) = s. find ( ' ' ) {
122
120
s[ ..space] . parse ( ) . ok ( )
123
121
} else {
You can’t perform that action at this time.
0 commit comments