File tree Expand file tree Collapse file tree 4 files changed +9
-24
lines changed Expand file tree Collapse file tree 4 files changed +9
-24
lines changed Original file line number Diff line number Diff line change @@ -85,16 +85,13 @@ fn main() {
8585
8686 let mut artifact_path = None ;
8787 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 ] ) ) ;
9593 }
9694 }
97- _ => ( ) , // Unknown message
9895 }
9996 }
10097
Original file line number Diff line number Diff line change @@ -140,16 +140,11 @@ impl FileSetConfig {
140140}
141141
142142/// Builder for [`FileSetConfig`].
143+ #[ derive( Default ) ]
143144pub struct FileSetConfigBuilder {
144145 roots : Vec < Vec < VfsPath > > ,
145146}
146147
147- impl Default for FileSetConfigBuilder {
148- fn default ( ) -> Self {
149- FileSetConfigBuilder { roots : Vec :: new ( ) }
150- }
151- }
152-
153148impl FileSetConfigBuilder {
154149 /// Returns the number of sets currently held.
155150 pub fn len ( & self ) -> usize {
Original file line number Diff line number Diff line change @@ -9,16 +9,11 @@ use rustc_hash::FxHasher;
99use crate :: { FileId , VfsPath } ;
1010
1111/// Structure to map between [`VfsPath`] and [`FileId`].
12+ #[ derive( Default ) ]
1213pub ( crate ) struct PathInterner {
1314 map : IndexSet < VfsPath , BuildHasherDefault < FxHasher > > ,
1415}
1516
16- impl Default for PathInterner {
17- fn default ( ) -> Self {
18- Self { map : IndexSet :: default ( ) }
19- }
20- }
21-
2217impl PathInterner {
2318 /// Get the id corresponding to `path`.
2419 ///
Original file line number Diff line number Diff line change @@ -113,11 +113,9 @@ fn unescape(s: &str) -> String {
113113fn parse_pr_number ( s : & str ) -> Option < u32 > {
114114 const BORS_PREFIX : & str = "Merge #" ;
115115 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 ) {
118117 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 ) {
121119 if let Some ( space) = s. find ( ' ' ) {
122120 s[ ..space] . parse ( ) . ok ( )
123121 } else {
You can’t perform that action at this time.
0 commit comments