File tree Expand file tree Collapse file tree 2 files changed +9
-10
lines changed Expand file tree Collapse file tree 2 files changed +9
-10
lines changed Original file line number Diff line number Diff line change @@ -207,7 +207,7 @@ impl<'a> TopicManager<'a> {
207
207
}
208
208
209
209
/// Enable select topic
210
- pub fn add ( & mut self , topic : & str ) -> Result < ( ) > {
210
+ pub fn add ( & mut self , topic : & str ) -> Result < Topic > {
211
211
debug ! ( "oma will opt_in: {}" , topic) ;
212
212
213
213
let index = self
@@ -220,11 +220,13 @@ impl<'a> TopicManager<'a> {
220
220
debug ! ( "Enabled: {enabled_names:?}" ) ;
221
221
222
222
if let Some ( index) = index {
223
+ let ic = index. clone ( ) ;
224
+ let icc = index. clone ( ) ;
223
225
if !enabled_names. contains ( & & index. name ) {
224
- self . enabled . push ( index . clone ( ) ) ;
226
+ self . enabled . push ( ic ) ;
225
227
}
226
228
227
- return Ok ( ( ) ) ;
229
+ return Ok ( icc ) ;
228
230
}
229
231
230
232
debug ! ( "index: {index:?} does not exist" ) ;
Original file line number Diff line number Diff line change @@ -450,8 +450,11 @@ async fn topics_inner(
450
450
. unwrap ( ) ?;
451
451
}
452
452
453
+ let mut enabled_pkgs = vec ! [ ] ;
454
+
453
455
for i in opt_in {
454
- tm. add ( i) ?;
456
+ let t = tm. add ( i) ?;
457
+ enabled_pkgs. extend ( t. packages ) ;
455
458
}
456
459
457
460
let mut downgrade_pkgs = vec ! [ ] ;
@@ -460,12 +463,6 @@ async fn topics_inner(
460
463
downgrade_pkgs. extend ( removed_topic. packages ) ;
461
464
}
462
465
463
- let enabled_pkgs = tm
464
- . enabled_topics ( )
465
- . iter ( )
466
- . flat_map ( |x| x. packages . clone ( ) )
467
- . collect :: < Vec < _ > > ( ) ;
468
-
469
466
Ok ( TopicChanged {
470
467
enabled_pkgs,
471
468
downgrade_pkgs,
You can’t perform that action at this time.
0 commit comments