Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/syntax/src/ast/token_ext.rs')
-rw-r--r--crates/syntax/src/ast/token_ext.rs8
1 files changed, 3 insertions, 5 deletions
diff --git a/crates/syntax/src/ast/token_ext.rs b/crates/syntax/src/ast/token_ext.rs
index 8990f7a7d4..2cd312e7f4 100644
--- a/crates/syntax/src/ast/token_ext.rs
+++ b/crates/syntax/src/ast/token_ext.rs
@@ -436,9 +436,7 @@ mod tests {
fn check_string_value<'a>(lit: &str, expected: impl Into<Option<&'a str>>) {
assert_eq!(
- ast::String { syntax: make::tokens::literal(&format!("\"{}\"", lit)) }
- .value()
- .as_deref(),
+ ast::String { syntax: make::tokens::literal(&format!("\"{lit}\"")) }.value().as_deref(),
expected.into()
);
}
@@ -461,7 +459,7 @@ bcde", "abcde",
expected: impl Into<Option<&'a [u8; N]>>,
) {
assert_eq!(
- ast::ByteString { syntax: make::tokens::literal(&format!("b\"{}\"", lit)) }
+ ast::ByteString { syntax: make::tokens::literal(&format!("b\"{lit}\"")) }
.value()
.as_deref(),
expected.into().map(|value| &value[..])
@@ -483,7 +481,7 @@ bcde", b"abcde",
#[test]
fn test_value_underscores() {
- check_float_value("3.141592653589793_f64", 3.141592653589793_f64);
+ check_float_value("1.234567891011121_f64", 1.234567891011121_f64);
check_float_value("1__0.__0__f32", 10.0);
check_int_value("0b__1_0_", 2);
check_int_value("1_1_1_1_1_1", 111111);