File tree Expand file tree Collapse file tree 3 files changed +14
-6
lines changed Expand file tree Collapse file tree 3 files changed +14
-6
lines changed Original file line number Diff line number Diff line change
1
+ use self :: shared:: ModifierSet ;
1
2
use std:: fmt:: Write ;
2
3
use std:: iter:: Peekable ;
3
4
use std:: path:: Path ;
4
5
5
6
type StrResult < T > = Result < T , String > ;
6
7
7
- include ! ( "src/shared.rs" ) ;
8
+ #[ path = "src/shared.rs" ]
9
+ mod shared;
8
10
9
- declare_types ! {
11
+ self :: shared :: declare_types! {
10
12
<' a>
11
13
str = & ' a str ,
12
14
List = Vec <_>
@@ -97,7 +99,7 @@ fn tokenize(line: &str) -> StrResult<Line> {
97
99
validate_ident ( part) ?;
98
100
}
99
101
let c = decode_char ( tail. ok_or ( "missing char" ) ?) ?;
100
- Line :: Variant ( ModifierSet ( rest) , c)
102
+ Line :: Variant ( ModifierSet :: new_unchecked ( rest) , c)
101
103
} else {
102
104
validate_ident ( head) ?;
103
105
let c = tail. map ( decode_char) . transpose ( ) ?;
Original file line number Diff line number Diff line change 8
8
//! that don't contain the character `.`, but codex only defines
9
9
//! ones that are entirely made of ASCII alphabetical characters.
10
10
11
- include ! ( "shared.rs" ) ;
11
+ pub use self :: shared:: ModifierSet ;
12
+
13
+ mod shared;
12
14
13
15
type StaticSlice < T > = & ' static [ T ] ;
14
- declare_types ! {
16
+ self :: shared :: declare_types! {
15
17
derive( Debug , Copy , Clone ) ,
16
18
str = & ' static str ,
17
19
List = StaticSlice <_>
Original file line number Diff line number Diff line change @@ -45,9 +45,13 @@ macro_rules! declare_types {
45
45
} ;
46
46
}
47
47
48
+ pub ( crate ) use declare_types;
49
+
48
50
/// A set of modifiers.
49
51
#[ derive( Debug , Copy , Clone ) ]
50
- pub struct ModifierSet < S > ( S ) ;
52
+ // note: the visibility needs to be `pub(crate)`,
53
+ // since build.rs outputs `ModifierSet(...)`
54
+ pub struct ModifierSet < S > ( pub ( crate ) S ) ;
51
55
52
56
impl < S : Default > Default for ModifierSet < S > {
53
57
/// Construct the default modifier set.
You can’t perform that action at this time.
0 commit comments