Skip to content

Commit

Permalink
fix playground _complex_ keys
Browse files Browse the repository at this point in the history
  • Loading branch information
Zheoni committed Jan 19, 2025
1 parent 3f33513 commit 2427002
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions playground/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use cooklang::ast::build_ast;
use cooklang::error::SourceReport;
use cooklang::metadata::{NameAndUrl, RecipeTime};
use cooklang::metadata::{CooklangValueExt, NameAndUrl, RecipeTime};
use cooklang::{parser::PullParser, Extensions};
use cooklang::{Converter, CooklangParser, IngredientReferenceTarget, Item};
use std::fmt::Write;
Expand Down Expand Up @@ -174,7 +174,7 @@ fn render(r: cooklang::ScaledRecipe, converter: &Converter) -> String {
ul {
@for (key, value) in &r.metadata.map {
li.metadata {
span.key { (key.as_str().unwrap_or("<not string key>")) } ":" (value.as_str().unwrap_or("<not string value>")) // TODO
span.key { (key.as_str_like().unwrap_or_else(|| format!("{key:?}").into())) } ":" (value.as_str_like().unwrap_or_else(|| format!("{value:?}").into()))
}
}
}
Expand Down

0 comments on commit 2427002

Please sign in to comment.