File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -40,15 +40,15 @@ pub fn _query_all_by_label_text<M: Into<Matcher>>(
4040 let label_list = get_labels ( container, & labelled_element, Some ( selector. clone ( ) ) ) ;
4141
4242 for label in & label_list {
43- if let Some ( form_control) = label. form_control . as_ref ( ) {
44- if matcher (
43+ if let Some ( form_control) = label. form_control . as_ref ( )
44+ && matcher (
4545 label. content . clone ( ) ,
4646 label. form_control . as_deref ( ) ,
4747 & text,
4848 match_normalizer. as_ref ( ) ,
49- ) {
50- labelled_elements . push ( form_control . clone ( ) ) ;
51- }
49+ )
50+ {
51+ labelled_elements . push ( form_control . clone ( ) ) ;
5252 }
5353 }
5454
Original file line number Diff line number Diff line change @@ -83,12 +83,11 @@ static ELEMENT_ROLE_LIST: LazyLock<Vec<ElementRole>> = LazyLock::new(|| {
8383
8484 result. push ( ElementRole {
8585 r#match : Box :: new ( move |element| {
86- if type_text_index. is_some ( ) {
87- if let Some ( input_element) = element. dyn_ref :: < HtmlInputElement > ( ) {
88- if input_element. type_ ( ) != "text" {
89- return false ;
90- }
91- }
86+ if type_text_index. is_some ( )
87+ && let Some ( input_element) = element. dyn_ref :: < HtmlInputElement > ( )
88+ && input_element. type_ ( ) != "text"
89+ {
90+ return false ;
9291 }
9392
9493 element. matches ( & selector) . unwrap_or ( false )
Original file line number Diff line number Diff line change @@ -203,17 +203,17 @@ fn create_indent(indent: usize) -> String {
203203pub fn format ( val : & JsValue , options : PrettyFormatOptions ) -> Result < String , PrettyFormatError > {
204204 validate_options ( & options) ?;
205205
206- if let Some ( plugins) = & options. plugins {
207- if let Some ( plugin) = find_plugin ( plugins, val) {
208- return Ok ( print_plugin (
209- plugin ,
210- val ,
211- & get_config ( options ) ,
212- "" . into ( ) ,
213- 0 ,
214- vec ! [ ] ,
215- ) ) ;
216- }
206+ if let Some ( plugins) = & options. plugins
207+ && let Some ( plugin) = find_plugin ( plugins, val)
208+ {
209+ return Ok ( print_plugin (
210+ plugin ,
211+ val ,
212+ & get_config ( options ) ,
213+ "" . into ( ) ,
214+ 0 ,
215+ vec ! [ ] ,
216+ ) ) ;
217217 }
218218
219219 let basic_result = print_basic_value (
You can’t perform that action at this time.
0 commit comments