Function git_config::parser::parse_from_path [−][src]
pub fn parse_from_path<P: AsRef<Path>>(
path: P
) -> Result<Parser<'static>, ParserOrIoError<'static>>
Expand description
Parses a git config located at the provided path. On success, returns a
Parser
that provides methods to accessing leading comments and sections
of a git-config
file and can be converted into an iterator of Event
for higher level processing.
Note that since we accept a path rather than a reference to the actual bytes, this function is not zero-copy, as the Parser must own (and thus copy) the bytes that it reads from. Consider one of the other variants if performance is a concern.
Errors
Returns an error if there was an IO error or the read file is not a valid
git-config
This generally is due to either invalid names or if there’s
extraneous data succeeding valid git-config
data.