From: Ian Jackson Date: Sat, 14 May 2022 18:07:19 +0000 (+0100) Subject: shapelib: Do not "note" the nonexistent SVG for magic items X-Git-Tag: otter-1.1.0~179 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=2761fc0119c2286445aa50824361ab6cc8c0bd1d;p=otter.git shapelib: Do not "note" the nonexistent SVG for magic items These do not need processing during bundle upload. Indeed, attempting it causes it to fail since there isn't actually any SVG. Signed-off-by: Ian Jackson --- diff --git a/src/shapelib.rs b/src/shapelib.rs index 44f18e3d..110a988d 100644 --- a/src/shapelib.rs +++ b/src/shapelib.rs @@ -1016,6 +1016,9 @@ pub trait LibrarySource: LibrarySvgNoter { fn svg_noter(&mut self) -> &mut dyn LibrarySvgNoter; } +pub struct NullLibrarySvgNoter; +impl LibrarySvgNoter for NullLibrarySvgNoter { } + struct BuiltinLibrary<'l> { catalogue_data: &'l str, dirname: &'l str, @@ -1303,7 +1306,8 @@ fn process_files_entry( error, })?; - l.add_item(src, src_name, &item_name, CatEnt::Magic { + l.add_item(&mut NullLibrarySvgNoter, // there's no SVG for *this* item + src_name, &item_name, CatEnt::Magic { group: group.clone(), spec: spec.into(), })?;