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 ;
12use std:: fmt:: Write ;
23use std:: iter:: Peekable ;
34use std:: path:: Path ;
45
56type StrResult < T > = Result < T , String > ;
67
7- include ! ( "src/shared.rs" ) ;
8+ #[ path = "src/shared.rs" ]
9+ mod shared;
810
9- declare_types ! {
11+ self :: shared :: declare_types! {
1012 <' a>
1113 str = & ' a str ,
1214 List = Vec <_>
@@ -97,7 +99,7 @@ fn tokenize(line: &str) -> StrResult<Line> {
9799 validate_ident ( part) ?;
98100 }
99101 let c = decode_char ( tail. ok_or ( "missing char" ) ?) ?;
100- Line :: Variant ( ModifierSet ( rest) , c)
102+ Line :: Variant ( ModifierSet :: new_unchecked ( rest) , c)
101103 } else {
102104 validate_ident ( head) ?;
103105 let c = tail. map ( decode_char) . transpose ( ) ?;
Original file line number Diff line number Diff line change 88//! that don't contain the character `.`, but codex only defines
99//! ones that are entirely made of ASCII alphabetical characters.
1010
11- include ! ( "shared.rs" ) ;
11+ pub use self :: shared:: ModifierSet ;
12+
13+ mod shared;
1214
1315type StaticSlice < T > = & ' static [ T ] ;
14- declare_types ! {
16+ self :: shared :: declare_types! {
1517 derive( Debug , Copy , Clone ) ,
1618 str = & ' static str ,
1719 List = StaticSlice <_>
Original file line number Diff line number Diff line change @@ -45,9 +45,13 @@ macro_rules! declare_types {
4545 } ;
4646}
4747
48+ pub ( crate ) use declare_types;
49+
4850/// A set of modifiers.
4951#[ 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 ) ;
5155
5256impl < S : Default > Default for ModifierSet < S > {
5357 /// Construct the default modifier set.
You can’t perform that action at this time.
0 commit comments