@@ -321,6 +321,58 @@ fn verify_dependencies(
321321 Ok ( ( ) )
322322}
323323
324+ fn transmit (
325+ gctx : & GlobalContext ,
326+ pkg : & Package ,
327+ tarball : & File ,
328+ registry : & mut Registry ,
329+ registry_id : SourceId ,
330+ dry_run : bool ,
331+ ) -> CargoResult < ( ) > {
332+ let new_crate = prepare_transmit ( gctx, pkg, registry_id, true ) ?;
333+
334+ // Do not upload if performing a dry run
335+ if dry_run {
336+ gctx. shell ( ) . warn ( "aborting upload due to dry run" ) ?;
337+ return Ok ( ( ) ) ;
338+ }
339+
340+ let warnings = registry
341+ . publish ( & new_crate, tarball)
342+ . with_context ( || format ! ( "failed to publish to registry at {}" , registry. host( ) ) ) ?;
343+
344+ if !warnings. invalid_categories . is_empty ( ) {
345+ let msg = format ! (
346+ "the following are not valid category slugs and were \
347+ ignored: {}. Please see https://crates.io/category_slugs \
348+ for the list of all category slugs. \
349+ ",
350+ warnings. invalid_categories. join( ", " )
351+ ) ;
352+ gctx. shell ( ) . warn ( & msg) ?;
353+ }
354+
355+ if !warnings. invalid_badges . is_empty ( ) {
356+ let msg = format ! (
357+ "the following are not valid badges and were ignored: {}. \
358+ Either the badge type specified is unknown or a required \
359+ attribute is missing. Please see \
360+ https://doc.rust-lang.org/cargo/reference/manifest.html#package-metadata \
361+ for valid badge types and their required attributes.",
362+ warnings. invalid_badges. join( ", " )
363+ ) ;
364+ gctx. shell ( ) . warn ( & msg) ?;
365+ }
366+
367+ if !warnings. other . is_empty ( ) {
368+ for msg in warnings. other {
369+ gctx. shell ( ) . warn ( & msg) ?;
370+ }
371+ }
372+
373+ Ok ( ( ) )
374+ }
375+
324376pub ( crate ) fn prepare_transmit (
325377 gctx : & GlobalContext ,
326378 pkg : & Package ,
@@ -467,55 +519,3 @@ pub(crate) fn prepare_transmit(
467519 rust_version,
468520 } )
469521}
470-
471- fn transmit (
472- gctx : & GlobalContext ,
473- pkg : & Package ,
474- tarball : & File ,
475- registry : & mut Registry ,
476- registry_id : SourceId ,
477- dry_run : bool ,
478- ) -> CargoResult < ( ) > {
479- let new_crate = prepare_transmit ( gctx, pkg, registry_id, true ) ?;
480-
481- // Do not upload if performing a dry run
482- if dry_run {
483- gctx. shell ( ) . warn ( "aborting upload due to dry run" ) ?;
484- return Ok ( ( ) ) ;
485- }
486-
487- let warnings = registry
488- . publish ( & new_crate, tarball)
489- . with_context ( || format ! ( "failed to publish to registry at {}" , registry. host( ) ) ) ?;
490-
491- if !warnings. invalid_categories . is_empty ( ) {
492- let msg = format ! (
493- "the following are not valid category slugs and were \
494- ignored: {}. Please see https://crates.io/category_slugs \
495- for the list of all category slugs. \
496- ",
497- warnings. invalid_categories. join( ", " )
498- ) ;
499- gctx. shell ( ) . warn ( & msg) ?;
500- }
501-
502- if !warnings. invalid_badges . is_empty ( ) {
503- let msg = format ! (
504- "the following are not valid badges and were ignored: {}. \
505- Either the badge type specified is unknown or a required \
506- attribute is missing. Please see \
507- https://doc.rust-lang.org/cargo/reference/manifest.html#package-metadata \
508- for valid badge types and their required attributes.",
509- warnings. invalid_badges. join( ", " )
510- ) ;
511- gctx. shell ( ) . warn ( & msg) ?;
512- }
513-
514- if !warnings. other . is_empty ( ) {
515- for msg in warnings. other {
516- gctx. shell ( ) . warn ( & msg) ?;
517- }
518- }
519-
520- Ok ( ( ) )
521- }
0 commit comments