File tree 4 files changed +6
-8
lines changed
4 files changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -286,7 +286,7 @@ jobs:
286
286
287
287
- uses : actions/setup-node@v4
288
288
with :
289
- node-version : " 18 "
289
+ node-version : " 20 "
290
290
291
291
- name : Install wasm-pack
292
292
run : |
Original file line number Diff line number Diff line change @@ -69,7 +69,7 @@ fn parse_exact_version(ver: &str) -> Option<Version> {
69
69
let first_byte = version. as_bytes ( ) . first ( ) ;
70
70
71
71
// Version is exact if it starts with an explicit == or a number
72
- if version. starts_with ( "==" ) || first_byte. map_or ( false , |v| v. is_ascii_digit ( ) ) {
72
+ if version. starts_with ( "==" ) || first_byte. is_some_and ( |v| v. is_ascii_digit ( ) ) {
73
73
let version = version. replace ( "==" , "" ) ;
74
74
let version = version. as_str ( ) . trim ( ) ;
75
75
if let Ok ( v) = Version :: parse ( version) {
Original file line number Diff line number Diff line change @@ -2296,7 +2296,7 @@ impl<'a> DesugarUse<'a> {
2296
2296
2297
2297
// If there's arguments on the left hand side of the function we extract
2298
2298
// those so we can paste them back as the anonymous function arguments.
2299
- let assignments = if type_. fn_arity ( ) . map_or ( false , |arity| arity >= 1 ) {
2299
+ let assignments = if type_. fn_arity ( ) . is_some_and ( |arity| arity >= 1 ) {
2300
2300
let assignments_range =
2301
2301
use_. assignments_location . start as usize ..use_. assignments_location . end as usize ;
2302
2302
self . module
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ use gleam_core::{
5
5
} ;
6
6
use itertools:: Itertools ;
7
7
use regex:: Regex ;
8
- use std:: { collections:: HashMap , fmt:: Write , sync:: OnceLock } ;
8
+ use std:: { collections:: HashMap , fmt:: Write , sync:: LazyLock } ;
9
9
10
10
#[ derive( Debug ) ]
11
11
pub struct TestCompileOutput {
@@ -45,9 +45,6 @@ impl TestCompileOutput {
45
45
46
46
Content :: Text ( text) => {
47
47
let text = FILE_LINE_REGEX
48
- . get_or_init ( || {
49
- Regex :: new ( r#"-file\("([^"]+)", (\d+)\)\."# ) . expect ( "Invalid regex" )
50
- } )
51
48
. replace_all ( text, |caps : & regex:: Captures | {
52
49
let path = caps
53
50
. get ( 1 )
@@ -95,7 +92,8 @@ pub fn to_in_memory_filesystem(path: &Utf8Path) -> InMemoryFileSystem {
95
92
fs
96
93
}
97
94
98
- static FILE_LINE_REGEX : OnceLock < Regex > = OnceLock :: new ( ) ;
95
+ static FILE_LINE_REGEX : LazyLock < Regex > =
96
+ LazyLock :: new ( || Regex :: new ( r#"-file\("([^"]+)", (\d+)\)\."# ) . expect ( "Invalid regex" ) ) ;
99
97
100
98
pub fn normalise_diagnostic ( text : & str ) -> String {
101
99
// There is an extra ^ on Windows in some error messages' code
You can’t perform that action at this time.
0 commit comments