git.delta.rocks / jrsonnet / refs/commits / b7f71f558179

difftreelog

feat better Display for ImportSyntaxError

Yaroslav Bolyukin2020-11-17parent: #8f633f4.patch.diff
in: master

1 file changed

modifiedcrates/jrsonnet-evaluator/src/error.rsdiffbeforeafterboth
78 ImportBadFileUtf8(PathBuf),78 ImportBadFileUtf8(PathBuf),
79 #[error("tried to import {1} from {0}, but imports is not supported")]79 #[error("tried to import {1} from {0}, but imports is not supported")]
80 ImportNotSupported(PathBuf, PathBuf),80 ImportNotSupported(PathBuf, PathBuf),
81 #[error("syntax error")]81 #[error(
82 "syntax error, expected one of {}, got {:?}",
83 .error.expected,
84 .source_code.chars().nth(error.location.offset).map(|c| c.to_string()).unwrap_or("EOF".into())
85 )]
82 ImportSyntaxError {86 ImportSyntaxError {
83 path: Rc<PathBuf>,87 path: Rc<PathBuf>,