rust/rhg/src/main.rs
changeset 49491 f3cd2d6eeef9
parent 49227 411d591e0a27
child 49495 a0d189b2e871
equal deleted inserted replaced
49490:5846bc8a2855 49491:f3cd2d6eeef9
   685         // All extensions are to be ignored, nothing to do here
   685         // All extensions are to be ignored, nothing to do here
   686         return Ok(());
   686         return Ok(());
   687     }
   687     }
   688 
   688 
   689     let enabled: HashSet<&[u8]> = config
   689     let enabled: HashSet<&[u8]> = config
   690         .get_section_keys(b"extensions")
   690         .iter_section(b"extensions")
   691         .into_iter()
   691         .filter_map(|(extension, value)| {
   692         .map(|extension| {
   692             if value == b"!" {
       
   693                 // Filter out disabled extensions
       
   694                 return None;
       
   695             }
   693             // Ignore extension suboptions. Only `required` exists for now.
   696             // Ignore extension suboptions. Only `required` exists for now.
   694             // `rhg` either supports an extension or doesn't, so it doesn't
   697             // `rhg` either supports an extension or doesn't, so it doesn't
   695             // make sense to consider the loading of an extension.
   698             // make sense to consider the loading of an extension.
   696             extension.split_2(b':').unwrap_or((extension, b"")).0
   699             let actual_extension =
       
   700                 extension.split_2(b':').unwrap_or((extension, b"")).0;
       
   701             Some(actual_extension)
   697         })
   702         })
   698         .collect();
   703         .collect();
   699 
   704 
   700     let mut unsupported = enabled;
   705     let mut unsupported = enabled;
   701     for supported in SUPPORTED_EXTENSIONS {
   706     for supported in SUPPORTED_EXTENSIONS {