yog_data/expected/mod.rs
1//! A value that isn't what a format's own form takes.
2
3use substrate_data::{Problem, Reader, ValueRef};
4
5/// "expected `what`, found …": for a form [`substrate_data::Expected`]
6/// has no word for (`"auto"`, `"full"` or six numbers).
7pub fn expected(cx: &mut Reader<'_>, what: &str, found: &ValueRef<'_>) {
8 cx.problem_of(
9 Problem::Expected,
10 format!("expected {what}, found {}", found.kind()),
11 );
12}