File tree 1 file changed +19
-1
lines changed
1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -110,11 +110,29 @@ where
110
110
binaries
111
111
} )
112
112
. for_each ( |( package, binary) | {
113
- bins. entry ( package) . or_insert ( Vec :: new ( ) ) . push ( binary) ;
113
+ bins. entry ( pkgid_to_bin_name ( & package) )
114
+ . or_insert ( Vec :: new ( ) )
115
+ . push ( binary) ;
114
116
} ) ;
115
117
bins
116
118
}
117
119
120
+ fn pkgid_to_bin_name ( pkgid : & str ) -> String {
121
+ // the input is string in the format such as
122
+ // "path+file:///home/shnatsel/Code/cargo-auditable/cargo-auditable/tests/fixtures/lib_and_bin_crate#0.1.0"
123
+ // (for full docs see `cargo pkgid`)
124
+ // and we need just the crate name, e.g. "lib_and_bin_crate".
125
+ // Weirdly it doesn't use OS path separator, it always uses '/'
126
+ pkgid
127
+ . rsplit_once ( '/' )
128
+ . unwrap ( )
129
+ . 1
130
+ . split_once ( '#' )
131
+ . unwrap ( )
132
+ . 0
133
+ . to_owned ( )
134
+ }
135
+
118
136
fn ensure_build_succeeded ( output : & Output ) {
119
137
if !output. status . success ( ) {
120
138
let stderr = std:: io:: stderr ( ) ;
You can’t perform that action at this time.
0 commit comments