tinymist_package/registry/
dummy.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//! Dummy package registry implementation for testing purposes.

use std::{path::Path, sync::Arc};

use super::{PackageError, PackageRegistry, PackageSpec};

/// Dummy package registry that always returns a `NotFound` error.
#[derive(Default, Debug)]
pub struct DummyRegistry;

impl PackageRegistry for DummyRegistry {
    fn resolve(&self, spec: &PackageSpec) -> Result<Arc<Path>, PackageError> {
        Err(PackageError::NotFound(spec.clone()))
    }
}