Skip to content

Commit 04622d4

Browse files
chore: update to Rust edition 2024 (#23)
1 parent a3f5ca6 commit 04622d4

File tree

16 files changed

+90
-70
lines changed

16 files changed

+90
-70
lines changed

Cargo.lock

Lines changed: 30 additions & 30 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ resolver = "2"
44

55
[workspace.package]
66
authors = ["Rust For Web <info@rustforweb.org>"]
7-
edition = "2021"
7+
edition = "2024"
88
license = "MIT"
99
repository = "https://github.com/RustForWeb/testing-library"
1010
version = "0.0.1"

book/book.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ git-repository-url = "https://github.com/RustForWeb/testing-library"
1919
serve = true
2020

2121
[rust]
22-
edition = "2021"
22+
edition = "2024"

packages/dom/src/get_queries_for_element.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
use web_sys::HtmlElement;
22

33
use crate::{
4+
ByRoleMatcher, ByRoleOptions,
45
error::QueryError,
56
queries::*,
67
types::{Matcher, MatcherOptions, SelectorMatcherOptions, WaitForOptions},
7-
ByRoleMatcher, ByRoleOptions,
88
};
99

1010
pub fn get_queries_for_element(element: HtmlElement) -> BoundFunctions {

packages/dom/src/helpers.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use web_sys::{window, Document};
1+
use web_sys::{Document, window};
22

33
pub fn get_document() -> Document {
44
window()

packages/dom/src/matches.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use regex::Regex;
44
use web_sys::Element;
55

66
use crate::{
7-
error::QueryError, DefaultNormalizerOptions, Matcher, NormalizerFn, NormalizerOptions,
7+
DefaultNormalizerOptions, Matcher, NormalizerFn, NormalizerOptions, error::QueryError,
88
};
99

1010
pub fn fuzzy_matches(

packages/dom/src/queries/role.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
use std::collections::HashSet;
22

3-
use aria_query::{AriaProperty, AriaRole, ROLES, ROLE_ELEMENTS};
3+
use aria_query::{AriaProperty, AriaRole, ROLE_ELEMENTS, ROLES};
44
use dom_accessibility_api::{
5-
compute_accessible_description, compute_accessible_name, ComputeTextAlternativeOptions,
5+
ComputeTextAlternativeOptions, compute_accessible_description, compute_accessible_name,
66
};
77
use web_sys::HtmlElement;
88

packages/dom/src/query_helpers.rs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,24 @@
11
use web_sys::{Element, HtmlElement};
22

33
use crate::{
4+
Matcher, MatcherOptions, NormalizerOptions,
45
config::get_config,
56
error::QueryError,
67
matches::{fuzzy_matches, make_normalizer, matches},
78
util::node_list_to_vec,
8-
Matcher, MatcherOptions, NormalizerOptions,
99
};
1010

1111
pub fn get_element_error(message: Option<String>, container: Element) -> QueryError {
1212
(get_config().get_element_error)(message, container)
1313
}
1414

1515
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+
)
1722
}
1823

1924
pub fn query_all_by_attribute<M: Into<Matcher>>(
@@ -165,7 +170,7 @@ macro_rules! make_find_query {
165170

166171
#[macro_export]
167172
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) => {
169174
pub fn $name<M: Into<$matcher_type>>(
170175
container: &HtmlElement,
171176
matcher: M,
@@ -195,7 +200,7 @@ macro_rules! wrap_single_query_with_suggestion {
195200

196201
#[macro_export]
197202
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) => {
199204
pub fn $name<M: Into<$matcher_type>>(
200205
container: &HtmlElement,
201206
matcher: M,

packages/dom/src/role_helpers.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use aria_query::{
55
ELEMENT_ROLES,
66
};
77
use dom_accessibility_api::{
8-
compute_accessible_description, compute_accessible_name, ComputeTextAlternativeOptions,
8+
ComputeTextAlternativeOptions, compute_accessible_description, compute_accessible_name,
99
};
1010
use wasm_bindgen::JsCast;
1111
use web_sys::{Element, HtmlElement, HtmlInputElement, HtmlOptionElement};

packages/dom/src/suggestions.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
use web_sys::HtmlElement;
22

33
use crate::{
4-
types::{Method, Suggestion, Variant},
54
MatcherOptions,
5+
types::{Method, Suggestion, Variant},
66
};
77

88
fn make_suggestion(

0 commit comments

Comments
 (0)