@@ -37,8 +37,8 @@ macro_rules! suffixed_int_literals {
3737 pub fn $name( n : $kind) -> Literal {
3838 Literal {
3939 kind : LitKind :: Integer ,
40- text: FFIString :: new ( & n. to_string( ) ) ,
41- suffix: FFIString :: new ( stringify!( $kind) )
40+ text: FFIString :: from ( & n. to_string( ) ) ,
41+ suffix: FFIString :: from ( stringify!( $kind) )
4242 }
4343 }
4444 ) * )
@@ -49,8 +49,8 @@ macro_rules! unsuffixed_int_literals {
4949 pub fn $name( n : $kind) -> Literal {
5050 Literal {
5151 kind : LitKind :: Integer ,
52- text: FFIString :: new ( & n. to_string( ) ) ,
53- suffix: FFIString :: new ( "" )
52+ text: FFIString :: from ( & n. to_string( ) ) ,
53+ suffix: FFIString :: from ( "" )
5454 }
5555 }
5656 ) * )
@@ -95,16 +95,16 @@ impl Literal {
9595
9696 Literal {
9797 kind : LitKind :: Float ,
98- text : FFIString :: new ( & repr) ,
99- suffix : FFIString :: new ( "" ) ,
98+ text : FFIString :: from ( & repr) ,
99+ suffix : FFIString :: from ( "" ) ,
100100 }
101101 }
102102
103103 pub fn f32_suffixed ( n : f32 ) -> Self {
104104 Literal {
105105 kind : LitKind :: Float ,
106- text : FFIString :: new ( & n. to_string ( ) ) ,
107- suffix : FFIString :: new ( "f32" ) ,
106+ text : FFIString :: from ( & n. to_string ( ) ) ,
107+ suffix : FFIString :: from ( "f32" ) ,
108108 }
109109 }
110110
@@ -116,40 +116,40 @@ impl Literal {
116116
117117 Literal {
118118 kind : LitKind :: Float ,
119- text : FFIString :: new ( & repr) ,
120- suffix : FFIString :: new ( "" ) ,
119+ text : FFIString :: from ( & repr) ,
120+ suffix : FFIString :: from ( "" ) ,
121121 }
122122 }
123123
124124 pub fn f64_suffixed ( n : f64 ) -> Self {
125125 Literal {
126126 kind : LitKind :: Float ,
127- text : FFIString :: new ( & n. to_string ( ) ) ,
128- suffix : FFIString :: new ( "f64" ) ,
127+ text : FFIString :: from ( & n. to_string ( ) ) ,
128+ suffix : FFIString :: from ( "f64" ) ,
129129 }
130130 }
131131
132132 pub fn string ( string : & str ) -> Self {
133133 Literal {
134134 kind : LitKind :: Str ,
135- text : FFIString :: new ( string) ,
136- suffix : FFIString :: new ( "" ) ,
135+ text : FFIString :: from ( string) ,
136+ suffix : FFIString :: from ( "" ) ,
137137 }
138138 }
139139
140140 pub fn character ( c : char ) -> Self {
141141 Literal {
142142 kind : LitKind :: Char ,
143- text : FFIString :: new ( & c. to_string ( ) ) ,
144- suffix : FFIString :: new ( "" ) ,
143+ text : FFIString :: from ( & c. to_string ( ) ) ,
144+ suffix : FFIString :: from ( "" ) ,
145145 }
146146 }
147147
148148 pub fn byte_string ( bytes : & [ u8 ] ) -> Self {
149149 Literal {
150150 kind : LitKind :: ByteStr ,
151- text : FFIString :: new ( & bytes. escape_ascii ( ) . to_string ( ) ) ,
152- suffix : FFIString :: new ( "" ) ,
151+ text : FFIString :: from ( & bytes. escape_ascii ( ) . to_string ( ) ) ,
152+ suffix : FFIString :: from ( "" ) ,
153153 }
154154 }
155155
@@ -219,8 +219,8 @@ impl FromStr for Literal {
219219 // Structure that will be filled in by the cpp
220220 let mut lit = Literal {
221221 kind : LitKind :: Err ,
222- text : FFIString :: new ( "" ) ,
223- suffix : FFIString :: new ( "" ) ,
222+ text : FFIString :: from ( "" ) ,
223+ suffix : FFIString :: from ( "" ) ,
224224 } ;
225225 // TODO: We might want to pass a LexError by reference to retrieve
226226 // error information
0 commit comments