diff --git a/src/indexing/projection.rs b/src/indexing/projection.rs index 14fb4ea..5bd6285 100644 --- a/src/indexing/projection.rs +++ b/src/indexing/projection.rs @@ -22,6 +22,8 @@ use std::collections::HashSet; const DERIVED_LDRAW_PROVENANCE: &str = "ordinary-part"; +type OrdinarySource = (Vec, Vec, i64, String, String); + /// A repo-record projection event, decoupled from Hydrant's internal types so /// the projection can be unit-tested with synthetic data. #[derive(Debug, Clone)] @@ -957,10 +959,7 @@ async fn rebuild_ordinary_ldraw_resources(tx: &mut Transaction<'_, Sqlite>) -> a Ok(()) } -fn parse_ordinary_source( - file_json: &str, - resource_uri: &AtUri, -) -> anyhow::Result<(Vec, Vec, i64, String, String)> { +fn parse_ordinary_source(file_json: &str, resource_uri: &AtUri) -> anyhow::Result { let file: File = serde_json::from_str(file_json)?; let digest = file .digest diff --git a/src/ldraw/paths.rs b/src/ldraw/paths.rs index c6afb66..25d4869 100644 --- a/src/ldraw/paths.rs +++ b/src/ldraw/paths.rs @@ -46,6 +46,7 @@ pub fn project_part_path( /// The rkey is deliberately returned unchanged: Jacquard's validated rkey is /// already a safe relative path segment. This is a pure inverse of the /// authority encoding and is useful for route/path round-trip tests. +#[cfg(test)] pub fn decode_external_part_path(path: &CanonicalPath) -> Option<(String, String)> { let segments = path.segments().collect::>(); if segments.first().copied()? != "external" || segments.len() != 3 { @@ -77,6 +78,7 @@ fn encode_identity_segment(value: &str) -> String { out } +#[cfg(test)] fn decode_identity_segment(value: &str) -> Option { let bytes = value.strip_prefix('x')?.as_bytes(); let mut decoded = Vec::with_capacity(bytes.len()); @@ -103,6 +105,7 @@ fn hex_digit(value: u8) -> char { char::from(b"0123456789abcdef"[value as usize]) } +#[cfg(test)] fn from_hex(value: u8) -> Option { match value { b'0'..=b'9' => Some(value - b'0'), @@ -285,7 +288,7 @@ mod tests { ("did:plc:alpha", "a.b"), ("did:plc:alpha", "a~b:c"), ] { - let part = AtUri::new_owned(&format!( + let part = AtUri::new_owned(format!( "at://{authority}/space.polymodel.library.part/{rkey}" )) .unwrap(); diff --git a/src/viewer.rs b/src/viewer.rs index f4e681c..27b04d1 100644 --- a/src/viewer.rs +++ b/src/viewer.rs @@ -1537,7 +1537,6 @@ impl WorkerBridgeState { } = signals; let mut renderer_failed = renderer_failed; let mut worker_ready = worker_ready; - let worker_capabilities = worker_capabilities; let opts = web_sys::WorkerOptions::new(); opts.set_type(web_sys::WorkerType::Module);