@@ -93,7 +93,7 @@ impl ReadSet {
93
93
const SPACE : u8 = b' ' ;
94
94
const COLON : u8 = b':' ;
95
95
const PLUS : u8 = b'+' ;
96
- const READ_NUMBERS : & [ u8 ] = & [ b'1' , b'2' , b'3' , b'4' , b'5' , b'6' , b'7' , b'8' ] ;
96
+ const READ_NUMBERS : & [ u8 ] = b"12345678" ;
97
97
98
98
/// Produces an iterator over references to the template segments stored in this ``ReadSet``.
99
99
fn template_segments ( & self ) -> SegmentIter {
@@ -217,7 +217,7 @@ impl ReadSet {
217
217
if read_num < Self :: READ_NUMBERS . len ( ) {
218
218
writer. write_all ( & [ Self :: READ_NUMBERS [ read_num - 1 ] ] ) ?;
219
219
write ! ( writer, ":N:0:" ) ?;
220
- } else {
220
+ } else {
221
221
write ! ( writer, "{}:N:0:" , read_num) ?;
222
222
}
223
223
}
@@ -247,7 +247,7 @@ impl ReadSet {
247
247
248
248
if read_num < Self :: READ_NUMBERS . len ( ) {
249
249
writer. write_all ( & [ Self :: READ_NUMBERS [ read_num - 1 ] , b':' ] ) ?;
250
- } else {
250
+ } else {
251
251
write ! ( writer, "{}:" , read_num) ?;
252
252
}
253
253
writer. write_all ( remainder) ?;
@@ -546,6 +546,7 @@ impl DemuxMetric {
546
546
/// mismatches (see `--max-mismatches`).
547
547
/// 2. The difference between number of mismatches in the best and second best barcodes is greater
548
548
/// than or equal to the minimum mismatch delta (`--min-mismatch-delta`).
549
+ ///
549
550
/// The expected barcode sequence may contains Ns, which are not counted as mismatches regardless
550
551
/// of the observed base (e.g. the expected barcode `AAN` will have zero mismatches relative to
551
552
/// both the observed barcodes `AAA` and `AAN`).
@@ -754,7 +755,7 @@ impl Demux {
754
755
let mut new_sample_barcode_writers = None ;
755
756
let mut new_molecular_barcode_writers = None ;
756
757
757
- for ( optional_ws, target) in vec ! [
758
+ for ( optional_ws, target) in [
758
759
( template_writers, & mut new_template_writers) ,
759
760
( barcode_writers, & mut new_sample_barcode_writers) ,
760
761
( mol_writers, & mut new_molecular_barcode_writers) ,
@@ -907,7 +908,7 @@ impl Command for Demux {
907
908
) ;
908
909
909
910
let mut fq_iterators = fq_sources
910
- . zip ( self . read_structures . clone ( ) . into_iter ( ) )
911
+ . zip ( self . read_structures . clone ( ) )
911
912
. map ( |( source, read_structure) | {
912
913
ReadSetIterator :: new ( read_structure, source, self . skip_reasons . clone ( ) )
913
914
. read_ahead ( 1000 , 1000 )
@@ -1194,6 +1195,7 @@ mod tests {
1194
1195
skip_reasons : vec ! [ ] ,
1195
1196
} ;
1196
1197
let demux_result = demux_inputs. execute ( ) ;
1198
+ #[ allow( clippy:: permissions_set_readonly_false) ]
1197
1199
permissions. set_readonly ( false ) ;
1198
1200
fs:: set_permissions ( tmp. path ( ) , permissions) . unwrap ( ) ;
1199
1201
demux_result. unwrap ( ) ;
@@ -1888,11 +1890,11 @@ mod tests {
1888
1890
let read_structures =
1889
1891
vec ! [ ReadStructure :: from_str( "+T" ) . unwrap( ) , ReadStructure :: from_str( "7B" ) . unwrap( ) ] ;
1890
1892
1891
- let records = vec ! [
1893
+ let records = [
1892
1894
vec ! [ "AAAAAAA" , & SAMPLE1_BARCODE [ 0 ..7 ] ] , // barcode too short
1893
1895
vec ! [ "CCCCCCC" , SAMPLE1_BARCODE ] , // barcode the correct length
1894
1896
vec ! [ "" , SAMPLE1_BARCODE ] , // template basese too short
1895
- vec![ "G" , SAMPLE1_BARCODE ] , // barcode the correct length
1897
+ vec ! [ "G" , SAMPLE1_BARCODE ] ,
1896
1898
] ;
1897
1899
1898
1900
let input_files = vec ! [
@@ -1924,11 +1926,11 @@ mod tests {
1924
1926
let read_structures =
1925
1927
vec ! [ ReadStructure :: from_str( "+T" ) . unwrap( ) , ReadStructure :: from_str( "7B" ) . unwrap( ) ] ;
1926
1928
1927
- let records = vec ! [
1929
+ let records = [
1928
1930
vec ! [ "AAAAAAA" , & SAMPLE1_BARCODE [ 0 ..7 ] ] , // barcode too short
1929
1931
vec ! [ "CCCCCCC" , SAMPLE1_BARCODE ] , // barcode the correct length
1930
1932
vec ! [ "" , SAMPLE1_BARCODE ] , // template basese too short
1931
- vec![ "G" , SAMPLE1_BARCODE ] , // barcode the correct length
1933
+ vec ! [ "G" , SAMPLE1_BARCODE ] ,
1932
1934
] ;
1933
1935
1934
1936
let input_files = vec ! [
0 commit comments