@@ -298,19 +298,23 @@ impl SyncState {
298298 fn get_mut_group (
299299 & mut self ,
300300 src : & DebianSourcePkg ,
301- release : & String ,
302- component : & String ,
303- architecture : & String ,
301+ release : & str ,
302+ component : & str ,
303+ architecture : & str ,
304304 ) -> & mut SourcePackageReport {
305- let key = ( release. clone ( ) , component. clone ( ) , architecture. clone ( ) ) ;
305+ let key = (
306+ release. to_string ( ) ,
307+ component. to_string ( ) ,
308+ architecture. to_string ( ) ,
309+ ) ;
306310 let report = self
307311 . reports
308312 . entry ( key. clone ( ) )
309313 . or_insert_with ( || PackageReport {
310314 distribution : "debian" . to_string ( ) ,
311- release : Some ( release. clone ( ) ) ,
312- component : Some ( component. clone ( ) ) ,
313- architecture : architecture. clone ( ) ,
315+ release : Some ( release. to_string ( ) ) ,
316+ component : Some ( component. to_string ( ) ) ,
317+ architecture : architecture. to_string ( ) ,
314318 packages : Vec :: new ( ) ,
315319 } ) ;
316320
@@ -339,8 +343,8 @@ impl SyncState {
339343 src : & DebianSourcePkg ,
340344 bin : DebianBinPkg ,
341345 source : & str ,
342- release : & String ,
343- component : & String ,
346+ release : & str ,
347+ component : & str ,
344348 ) {
345349 let group = self . get_mut_group ( src, release, component, & bin. architecture ) ;
346350 let url = format ! ( "{}/{}" , source, bin. filename) ;
@@ -360,8 +364,8 @@ impl SyncState {
360364 & mut self ,
361365 pkg : DebianBinPkg ,
362366 sources : & SourcePkgBucket ,
363- release : & String ,
364- component : & String ,
367+ release : & str ,
368+ component : & str ,
365369 sync : & PkgsSync ,
366370 ) -> Result < ( ) > {
367371 // Debian combines arch:all and arch:any packages.
@@ -392,8 +396,8 @@ impl SyncState {
392396 & mut self ,
393397 bytes : & [ u8 ] ,
394398 sources : & SourcePkgBucket ,
395- release : & String ,
396- component : & String ,
399+ release : & str ,
400+ component : & str ,
397401 sync : & PkgsSync ,
398402 ) -> Result < ( ) > {
399403 for pkg in extract_pkgs_compressed :: < DebianBinPkg > ( bytes) ? {
@@ -406,8 +410,8 @@ impl SyncState {
406410 & mut self ,
407411 bytes : & [ u8 ] ,
408412 sources : & SourcePkgBucket ,
409- release : & String ,
410- component : & String ,
413+ release : & str ,
414+ component : & str ,
411415 sync : & PkgsSync ,
412416 ) -> Result < ( ) > {
413417 for pkg in extract_pkgs_uncompressed :: < DebianBinPkg , _ > ( bytes) ? {
@@ -689,13 +693,7 @@ Section: misc
689693 uploaders : vec ! [ ] ,
690694 } ;
691695 let mut state = SyncState :: new ( ) ;
692- state. push (
693- & src,
694- bin,
695- "https://deb.debian.org/debian" ,
696- & "sid" . to_string ( ) ,
697- & "main" . to_string ( ) ,
698- ) ;
696+ state. push ( & src, bin, "https://deb.debian.org/debian" , "sid" , "main" ) ;
699697
700698 let mut reports = HashMap :: new ( ) ;
701699 reports. insert ( ( "sid" . to_string ( ) , "main" . to_string ( ) , "all" . to_string ( ) ) , PackageReport {
@@ -804,8 +802,8 @@ Section: misc
804802 & src_pkgs[ 0 ] ,
805803 bin,
806804 "https://deb.debian.org/debian" ,
807- & "sid" . to_string ( ) ,
808- & "main" . to_string ( ) ,
805+ "sid" ,
806+ "main" ,
809807 ) ;
810808 }
811809
@@ -1136,13 +1134,7 @@ Section: mail
11361134 let mut state = SyncState :: new ( ) ;
11371135 for bin in bin_pkgs {
11381136 let src = sources. get ( & bin) . unwrap ( ) ;
1139- state. push (
1140- & src,
1141- bin,
1142- "https://deb.debian.org/debian" ,
1143- & "sid" . to_string ( ) ,
1144- & "main" . to_string ( ) ,
1145- ) ;
1137+ state. push ( & src, bin, "https://deb.debian.org/debian" , "sid" , "main" ) ;
11461138 }
11471139
11481140 let mut reports = HashMap :: new ( ) ;
@@ -1495,22 +1487,10 @@ SHA256: cc2081a6b2f6dcb82039b5097405b5836017a7bfc54a78eba36b656549e17c92
14951487
14961488 // add the package list twice, to simulate importing sid and testing
14971489 state
1498- . import_uncompressed_binary_package_file (
1499- & bytes[ ..] ,
1500- & sources,
1501- & "sid" . to_string ( ) ,
1502- & "main" . to_string ( ) ,
1503- & sync,
1504- )
1490+ . import_uncompressed_binary_package_file ( & bytes[ ..] , & sources, "sid" , "main" , & sync)
15051491 . unwrap ( ) ;
15061492 state
1507- . import_uncompressed_binary_package_file (
1508- & bytes[ ..] ,
1509- & sources,
1510- & "testing" . to_string ( ) ,
1511- & "main" . to_string ( ) ,
1512- & sync,
1513- )
1493+ . import_uncompressed_binary_package_file ( & bytes[ ..] , & sources, "testing" , "main" , & sync)
15141494 . unwrap ( ) ;
15151495
15161496 let mut reports = HashMap :: new ( ) ;
@@ -1578,9 +1558,9 @@ SHA256: cc2081a6b2f6dcb82039b5097405b5836017a7bfc54a78eba36b656549e17c92
15781558 sync_method : None ,
15791559 } ;
15801560
1581- for ( source , binary ) in [
1582- // sid
1583- ( & b"Package: novnc
1561+ // sid
1562+ let ( source , binary ) = (
1563+ & b"Package: novnc
15841564Binary: novnc, python3-novnc
15851565Version: 1:1.6.0-1
15861566Maintainer: Debian OpenStack <[email protected] > @@ -1670,15 +1650,18 @@ Size: 12664
16701650MD5sum: e088e49616de39f4cfa162959335340e
16711651SHA256: 89c378d37058ea2a6c5d4bb2c1d47c4810f7504bde9e4d8142ac9781ce9df002
16721652
1673- " [ ..] ) , ] {
1674- let mut sources = SourcePkgBucket :: new ( ) ;
1675- sources. import_uncompressed_source_package_file ( & source[ ..] ) . unwrap ( ) ;
1676- state. import_uncompressed_binary_package_file ( & binary[ ..] , & sources, & "sid" . to_string ( ) , & "main" . to_string ( ) , & sync) . unwrap ( ) ;
1677- }
1653+ " [ ..] ) ;
1654+ let mut sources = SourcePkgBucket :: new ( ) ;
1655+ sources
1656+ . import_uncompressed_source_package_file ( source)
1657+ . unwrap ( ) ;
1658+ state
1659+ . import_uncompressed_binary_package_file ( binary, & sources, "sid" , "main" , & sync)
1660+ . unwrap ( ) ;
16781661
1679- for ( source , binary ) in [
1680- // testing
1681- ( b"Package: novnc
1662+ // testing
1663+ let ( source , binary ) = (
1664+ b"Package: novnc
16821665Binary: novnc, python3-novnc
16831666Version: 1:1.6.0-1
16841667Maintainer: Debian OpenStack <[email protected] > @@ -1741,12 +1724,14 @@ Size: 12664
17411724MD5sum: e088e49616de39f4cfa162959335340e
17421725SHA256: 89c378d37058ea2a6c5d4bb2c1d47c4810f7504bde9e4d8142ac9781ce9df002
17431726
1744- " )
1745- ] {
1746- let mut sources = SourcePkgBucket :: new ( ) ;
1747- sources. import_uncompressed_source_package_file ( & source[ ..] ) . unwrap ( ) ;
1748- state. import_uncompressed_binary_package_file ( binary, & sources, & "testing" . to_string ( ) , & "main" . to_string ( ) , & sync) . unwrap ( ) ;
1749- }
1727+ " ) ;
1728+ let mut sources = SourcePkgBucket :: new ( ) ;
1729+ sources
1730+ . import_uncompressed_source_package_file ( & source[ ..] )
1731+ . unwrap ( ) ;
1732+ state
1733+ . import_uncompressed_binary_package_file ( binary, & sources, "testing" , "main" , & sync)
1734+ . unwrap ( ) ;
17501735
17511736 let mut reports = HashMap :: new ( ) ;
17521737
0 commit comments