pub fn from_parser(parser: &toml::Parser, name: &String) -> Vec<Self>
	{
		parser.errors.iter().map(|error|
		{
			let (start_line, start_col) = parser.to_linecol(error.lo);
			let (end_line, end_col) = parser.to_linecol(error.hi);
			// Note: The lines are 0 indexed so increment by 1.
			TomlParserError
			{
				filename: name.clone(),
				start_line: start_line + 1,
				start_col: start_col,
				end_line: end_line + 1,
				end_col: end_col,
				desc: error.desc.clone(),
			}
		}).collect()
	}
/// Generates a list of detailed TOML parser errors using the given `parser`.
///
/// This function queries the given `parser` for the list of errors, which normally returns
/// only the start and end bytes.
///
Generates a list of detailed TOML parser errors using the given `parser`.
This function queries the given `parser` for the list of errors, which normally returns
only the start and end bytes.
Generates a list of detailed TOML parser errors using the given ` parser ` . This function queries the given ` parser ` for the list of errors which normally returns only the start and end bytes .
pub fn from_parser(parser: &toml::Parser, name: &String) -> Vec<Self>
	{
		parser.errors.iter().map(|error|
		{
			let (start_line, start_col) = parser.to_linecol(error.lo);
			let (end_line, end_col) = parser.to_linecol(error.hi);
			// Note: The lines are 0 indexed so increment by 1.
			TomlParserError
			{
				filename: name.clone(),
				start_line: start_line + 1,
				start_col: start_col,
				end_line: end_line + 1,
				end_col: end_col,
				desc: error.desc.clone(),
			}
		}).collect()
	}
pub fn from_parser ( parser : & toml :: Parser , name : & String ) -> Vec < Self > { parser . errors . iter ( ) . map ( | error | { let ( start_line , start_col ) = parser . to_linecol ( error . lo ) ; let ( end_line , end_col ) = parser . to_linecol ( error . hi ) ; // Note: The lines are 0 indexed so increment by 1. TomlParserError { filename : name . clone ( ) , start_line : start_line + 1 , start_col : start_col , end_line : end_line + 1 , end_col : end_col , desc : error . desc . clone ( ) , } } ) . collect ( ) }
Generates a list of detailed TOML parser errors using the given `parser`.
Generates a list of detailed TOML parser errors using the given ` parser ` .
parser
&toml::Parser
name
&String
parser
&toml::Parser
name
&String