@@ -19,7 +19,7 @@ impl Array {
1919 }
2020 _ => {
2121 buf. add_line ( "let mut len = 0;" ) ;
22- buf. add_line ( "helpers ::get_u32(&mut len, input)?;" ) ;
22+ buf. add_line ( "xdr_lib ::get_u32(&mut len, input)?;" ) ;
2323 }
2424 } ;
2525 match & self . kind {
@@ -91,7 +91,7 @@ impl NamedDeclaration {
9191impl ValidatedUnion {
9292 pub ( super ) fn deserialize_definition ( & self , buf : & mut CodeBuf , tab : & ValidatedSymbolTable ) {
9393 buf. code_block (
94- "pub fn deserialize(&mut self, input: &mut &[u8]) -> Result<(), helpers ::DeserializeError>" ,
94+ "pub fn deserialize(&mut self, input: &mut &[u8]) -> Result<(), xdr_lib ::DeserializeError>" ,
9595 |buf| {
9696 match & self . body {
9797 ValidatedUnionBody :: Bool ( b) => b. deserialize_bool ( buf, tab) ,
@@ -106,7 +106,7 @@ impl ValidatedUnion {
106106impl ValidatedUnionBoolBody {
107107 pub ( super ) fn deserialize_bool ( & self , buf : & mut CodeBuf , tab : & ValidatedSymbolTable ) {
108108 buf. add_line ( "let mut discriminant: u32 = 0;" ) ;
109- buf. add_line ( "helpers ::get_u32(&mut discriminant, input)?;" ) ;
109+ buf. add_line ( "xdr_lib ::get_u32(&mut discriminant, input)?;" ) ;
110110 buf. block_statement ( "match discriminant" , |buf| {
111111 buf. add_line ( "0 => (*self).inner = None," ) ;
112112 buf. code_block ( "_ => " , |buf| {
@@ -124,7 +124,7 @@ impl ValidatedUnionBoolBody {
124124impl ValidatedUnionEnumBody {
125125 pub ( super ) fn deserialize_enum ( & self , buf : & mut CodeBuf , tab : & ValidatedSymbolTable ) {
126126 buf. add_line ( "let mut discriminant = 0;" ) ;
127- buf. add_line ( "helpers ::get_i32(&mut discriminant, input)?;" ) ;
127+ buf. add_line ( "xdr_lib ::get_i32(&mut discriminant, input)?;" ) ;
128128 buf. block_statement ( "*self = match discriminant" , |buf| {
129129 for arm in self . arms . iter ( ) {
130130 let discriminant_value = self . get_discriminant_value ( & arm. 0 , tab) ;
@@ -156,7 +156,7 @@ impl ValidatedUnionEnumBody {
156156 }
157157 } ;
158158 } else {
159- buf. add_line ( "_ => return Err(helpers ::DeserializeError)," ) ;
159+ buf. add_line ( "_ => return Err(xdr_lib ::DeserializeError)," ) ;
160160 }
161161 } ) ;
162162 }
@@ -165,7 +165,7 @@ impl ValidatedUnionEnumBody {
165165impl ValidatedStruct {
166166 pub ( super ) fn deserialize_definition ( & self , buf : & mut CodeBuf , tab : & ValidatedSymbolTable ) {
167167 buf. code_block (
168- "pub fn deserialize(&mut self, input: &mut &[u8]) -> Result<(), helpers ::DeserializeError>" ,
168+ "pub fn deserialize(&mut self, input: &mut &[u8]) -> Result<(), xdr_lib ::DeserializeError>" ,
169169 |buf| {
170170 for ( decl, _) in self . members . iter ( ) {
171171 buf. add_line ( & format ! ( "// {}:" , decl. name) ) ;
@@ -180,16 +180,16 @@ impl ValidatedStruct {
180180impl ValidatedEnum {
181181 pub ( super ) fn deserialize_definition ( & self , buf : & mut CodeBuf , tab : & ValidatedSymbolTable ) {
182182 buf. code_block (
183- "pub fn deserialize(&mut self, input: &mut &[u8]) -> Result<(), helpers ::DeserializeError>" ,
183+ "pub fn deserialize(&mut self, input: &mut &[u8]) -> Result<(), xdr_lib ::DeserializeError>" ,
184184 |buf| {
185185 buf. add_line ( "let mut val = 0;" ) ;
186- buf. add_line ( "helpers ::get_i32(&mut val, input)?;" ) ;
186+ buf. add_line ( "xdr_lib ::get_i32(&mut val, input)?;" ) ;
187187 buf. block_statement ( "*self = match val" , |buf| {
188188 for variant in self . variants . iter ( ) {
189189 let val = variant. 1 . as_const ( tab) ;
190190 buf. add_line ( & format ! ( "{} => {}::{}," , val, self . name, variant. 0 ) ) ;
191191 }
192- buf. add_line ( "_ => return Err(helpers ::DeserializeError)," ) ;
192+ buf. add_line ( "_ => return Err(xdr_lib ::DeserializeError)," ) ;
193193 } ) ;
194194 buf. add_line ( "Ok(())" ) ;
195195 } ,
@@ -220,14 +220,14 @@ impl XdrType {
220220
221221 fn deserialize_method ( & self ) -> String {
222222 match self {
223- XdrType :: Int => "helpers ::get_i32" . to_string ( ) ,
224- XdrType :: UInt => "helpers ::get_u32" . to_string ( ) ,
225- XdrType :: Hyper => "helpers ::get_i64" . to_string ( ) ,
226- XdrType :: UHyper => "helpers ::get_u64" . to_string ( ) ,
223+ XdrType :: Int => "xdr_lib ::get_i32" . to_string ( ) ,
224+ XdrType :: UInt => "xdr_lib ::get_u32" . to_string ( ) ,
225+ XdrType :: Hyper => "xdr_lib ::get_i64" . to_string ( ) ,
226+ XdrType :: UHyper => "xdr_lib ::get_u64" . to_string ( ) ,
227227 XdrType :: Float => todo ! ( ) ,
228228 XdrType :: Double => todo ! ( ) ,
229229 XdrType :: Quadruple => todo ! ( ) ,
230- XdrType :: Bool => "helpers ::get_bool" . to_string ( ) ,
230+ XdrType :: Bool => "xdr_lib ::get_bool" . to_string ( ) ,
231231 XdrType :: Name ( n) => format ! ( "{n}::deserialize" ) ,
232232 }
233233 }
@@ -241,15 +241,15 @@ impl XdrType {
241241 if self . self_referential_optional ( tab) {
242242 buf. code_block ( "loop" , |buf| {
243243 buf. add_line ( "let mut item_follows = 0;" ) ;
244- buf. add_line ( "helpers ::get_i32(&mut item_follows, input)?;" ) ;
244+ buf. add_line ( "xdr_lib ::get_i32(&mut item_follows, input)?;" ) ;
245245 buf. add_line ( "if item_follows == 0 { break; }" ) ;
246246 buf. add_line ( & format ! ( "let mut new = {};" , self . default_value( tab) ) ) ;
247247 self . deserialize_inline ( "new" , buf, tab) ;
248248 buf. add_line ( & format ! ( "{name}.push(new)" ) ) ;
249249 } ) ;
250250 } else {
251251 buf. add_line ( "let mut optional_follows = 0;" ) ;
252- buf. add_line ( "helpers ::get_i32(&mut optional_follows, input)?;" ) ;
252+ buf. add_line ( "xdr_lib ::get_i32(&mut optional_follows, input)?;" ) ;
253253 buf. block_statement ( & format ! ( "{name} = match optional_follows" ) , |buf| {
254254 buf. add_line ( "0 => None," ) ;
255255 buf. code_block ( "_ =>" , |buf| {
0 commit comments