File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ exclude = ["fuzz/**/*", "tests/**/*"]
1616criterion = " 0.2"
1717
1818[dependencies .hashmap_core ]
19- version = " 0.1.9 "
19+ version = " 0.1.10 "
2020optional = true
2121
2222[badges ]
Original file line number Diff line number Diff line change 2424//! a data-structure using this library.
2525
2626#![ cfg_attr( not( feature = "std" ) , no_std) ]
27- #![ cfg_attr( not( feature = "std" ) , feature( alloc) ) ]
2827
2928#[ cfg( not( feature = "std" ) ) ]
3029extern crate hashmap_core;
@@ -124,7 +123,7 @@ mod validator;
124123
125124#[ cfg( not( feature = "std" ) ) ]
126125mod std {
127- pub use alloc:: { boxed, vec} ;
126+ pub use alloc:: { boxed, string , vec} ;
128127 pub use core:: * ;
129128 pub mod collections {
130129 pub use hashmap_core:: HashSet ;
Original file line number Diff line number Diff line change @@ -269,8 +269,12 @@ impl<'a> Parser<'a> {
269269 . original_position ( ) ;
270270 }
271271 match self . section_reader {
272- ParserSectionReader :: CodeSectionReader ( ref reader) => return reader. original_position ( ) ,
273- ParserSectionReader :: DataSectionReader ( ref reader) => return reader. original_position ( ) ,
272+ ParserSectionReader :: CodeSectionReader ( ref reader) => {
273+ return reader. original_position ( )
274+ }
275+ ParserSectionReader :: DataSectionReader ( ref reader) => {
276+ return reader. original_position ( )
277+ }
274278 ParserSectionReader :: ElementSectionReader ( ref reader) => {
275279 return reader. original_position ( ) ;
276280 }
@@ -292,8 +296,12 @@ impl<'a> Parser<'a> {
292296 ParserSectionReader :: TableSectionReader ( ref reader) => {
293297 return reader. original_position ( ) ;
294298 }
295- ParserSectionReader :: TypeSectionReader ( ref reader) => return reader. original_position ( ) ,
296- ParserSectionReader :: NameSectionReader ( ref reader) => return reader. original_position ( ) ,
299+ ParserSectionReader :: TypeSectionReader ( ref reader) => {
300+ return reader. original_position ( )
301+ }
302+ ParserSectionReader :: NameSectionReader ( ref reader) => {
303+ return reader. original_position ( )
304+ }
297305 ParserSectionReader :: LinkingSectionReader ( ref reader) => {
298306 return reader. original_position ( ) ;
299307 }
Original file line number Diff line number Diff line change 1414 */
1515
1616use std:: boxed:: Box ;
17- use std:: error:: Error ;
1817use std:: fmt;
1918use std:: result;
2019
20+ #[ cfg( feature = "std" ) ]
21+ use std:: error:: Error ;
22+
2123#[ derive( Debug , Copy , Clone ) ]
2224pub struct BinaryReaderError {
2325 pub message : & ' static str ,
@@ -26,6 +28,7 @@ pub struct BinaryReaderError {
2628
2729pub type Result < T > = result:: Result < T , BinaryReaderError > ;
2830
31+ #[ cfg( feature = "std" ) ]
2932impl Error for BinaryReaderError { }
3033
3134impl fmt:: Display for BinaryReaderError {
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ use std::cmp::min;
1818use std:: collections:: HashSet ;
1919use std:: result;
2020use std:: str;
21+ use std:: string:: String ;
2122use std:: vec:: Vec ;
2223
2324use limits:: {
@@ -2016,7 +2017,7 @@ impl<'a> ValidatingParser<'a> {
20162017 }
20172018 ParserState :: ExportSectionEntry { field, kind, index } => {
20182019 self . validation_error = self . check_export_entry ( field, kind, index) . err ( ) ;
2019- self . exported_names . insert ( field . to_string ( ) ) ;
2020+ self . exported_names . insert ( String :: from ( field ) ) ;
20202021 }
20212022 ParserState :: StartSectionEntry ( func_index) => {
20222023 self . validation_error = self . check_start ( func_index) . err ( ) ;
You can’t perform that action at this time.
0 commit comments