File tree Expand file tree Collapse file tree 1 file changed +9
-9
lines changed
crates/qt-build-utils/src/qml Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -23,11 +23,11 @@ impl QmlUri {
23
23
let uri: Vec < _ > = uri. into_iter ( ) . map ( Into :: into) . collect ( ) ;
24
24
25
25
// Only allow alphanumeric uri parts for now
26
- if uri
27
- . iter ( )
28
- . any ( |part| part . chars ( ) . any ( |c| !c. is_ascii_alphanumeric ( ) ) )
29
- {
30
- panic ! ( "QML uri parts must be alphanumeric" ) ;
26
+ if uri. iter ( ) . any ( |part| {
27
+ part . chars ( )
28
+ . any ( |c| !( c. is_ascii_alphanumeric ( ) || c == '_' ) )
29
+ } ) {
30
+ panic ! ( "QML uri parts must be alphanumeric: {uri:?} " ) ;
31
31
}
32
32
33
33
Self { uri }
@@ -67,9 +67,9 @@ mod test {
67
67
68
68
#[ test]
69
69
fn as_n ( ) {
70
- let uri = QmlUri :: new ( [ "a" , "b" , "c " ] ) ;
71
- assert_eq ! ( uri. as_dirs( ) , "a/b/c " ) ;
72
- assert_eq ! ( uri. as_dots( ) , "a.b.c " ) ;
73
- assert_eq ! ( uri. as_underscores( ) , "a_b_c " ) ;
70
+ let uri = QmlUri :: new ( [ "a" , "b" , "c_d " ] ) ;
71
+ assert_eq ! ( uri. as_dirs( ) , "a/b/c_d " ) ;
72
+ assert_eq ! ( uri. as_dots( ) , "a.b.c_d " ) ;
73
+ assert_eq ! ( uri. as_underscores( ) , "a_b_c_d " ) ;
74
74
}
75
75
}
You can’t perform that action at this time.
0 commit comments