File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed
Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -110,11 +110,29 @@ where
110110 binaries
111111 } )
112112 . 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) ;
114116 } ) ;
115117 bins
116118}
117119
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+
118136fn ensure_build_succeeded ( output : & Output ) {
119137 if !output. status . success ( ) {
120138 let stderr = std:: io:: stderr ( ) ;
You can’t perform that action at this time.
0 commit comments