|
1 | 1 | use web_sys::{Element, HtmlElement}; |
2 | 2 |
|
3 | 3 | use crate::{ |
| 4 | + Matcher, MatcherOptions, NormalizerOptions, |
4 | 5 | config::get_config, |
5 | 6 | error::QueryError, |
6 | 7 | matches::{fuzzy_matches, make_normalizer, matches}, |
7 | 8 | util::node_list_to_vec, |
8 | | - Matcher, MatcherOptions, NormalizerOptions, |
9 | 9 | }; |
10 | 10 |
|
11 | 11 | pub fn get_element_error(message: Option<String>, container: Element) -> QueryError { |
12 | 12 | (get_config().get_element_error)(message, container) |
13 | 13 | } |
14 | 14 |
|
15 | 15 | pub fn get_multiple_elements_found_error(message: String, container: Element) -> QueryError { |
16 | | - get_element_error(Some(format!("{message}\n\n(If this is intentional, then use the `*_all_by_*` variant of the query (like `query_all_by_text`, `get_all_by_text`, or `find_all_by_text`)).")), container) |
| 16 | + get_element_error( |
| 17 | + Some(format!( |
| 18 | + "{message}\n\n(If this is intentional, then use the `*_all_by_*` variant of the query (like `query_all_by_text`, `get_all_by_text`, or `find_all_by_text`))." |
| 19 | + )), |
| 20 | + container, |
| 21 | + ) |
17 | 22 | } |
18 | 23 |
|
19 | 24 | pub fn query_all_by_attribute<M: Into<Matcher>>( |
@@ -165,7 +170,7 @@ macro_rules! make_find_query { |
165 | 170 |
|
166 | 171 | #[macro_export] |
167 | 172 | macro_rules! wrap_single_query_with_suggestion { |
168 | | - ($query:ident, $query_by_all_name:expr, $variant:expr, $name:ident, $matcher_type:ty, $options_type:ty) => { |
| 173 | + ($query:ident, $query_by_all_name:expr_2021, $variant:expr_2021, $name:ident, $matcher_type:ty, $options_type:ty) => { |
169 | 174 | pub fn $name<M: Into<$matcher_type>>( |
170 | 175 | container: &HtmlElement, |
171 | 176 | matcher: M, |
@@ -195,7 +200,7 @@ macro_rules! wrap_single_query_with_suggestion { |
195 | 200 |
|
196 | 201 | #[macro_export] |
197 | 202 | macro_rules! wrap_all_by_query_with_suggestion { |
198 | | - ($query:ident, $query_by_all_name:expr, $variant:expr, $name:ident, $matcher_type:ty, $options_type:ty) => { |
| 203 | + ($query:ident, $query_by_all_name:expr_2021, $variant:expr_2021, $name:ident, $matcher_type:ty, $options_type:ty) => { |
199 | 204 | pub fn $name<M: Into<$matcher_type>>( |
200 | 205 | container: &HtmlElement, |
201 | 206 | matcher: M, |
|
0 commit comments