Skip to content

Plan, apply and roll back changes to a production ontology, with a blast radius report and a proof an auditor can re-check.

fix: resolve clippy warnings for non-embeddings build

FABIOTESS6488d438bc92
diff --git a/src/config.rs b/src/config.rs
index db5f750a..9284a3d6 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -35,7 +35,7 @@ impl Default for GeneralConfig {
}
}
-#[derive(Debug, Deserialize, Clone)]
+#[derive(Debug, Default, Deserialize, Clone)]
#[serde(default)]
pub struct EmbeddingsConfig {
/// Path to the ONNX model file. Default: ~/.open-ontologies/models/bge-small-en-v1.5.onnx
@@ -44,15 +44,6 @@ pub struct EmbeddingsConfig {
pub tokenizer_path: Option<String>,
}
-impl Default for EmbeddingsConfig {
- fn default() -> Self {
- Self {
- model_path: None,
- tokenizer_path: None,
- }
- }
-}
-
/// Expand a leading `~` in a path to the user's home directory.
pub fn expand_tilde(path: &str) -> String {
if (path.starts_with("~/") || path == "~")
diff --git a/src/main.rs b/src/main.rs
index 16e9880b..be8ab269 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -356,7 +356,7 @@ async fn main() -> anyhow::Result<()> {
let cli = Cli::parse();
match cli.command {
- Commands::Init { data_dir, model_url, tokenizer_url, model_name } => {
+ Commands::Init { data_dir, model_url: _model_url, tokenizer_url: _tokenizer_url, model_name: _model_name } => {
let data_dir = expand_tilde(&data_dir);
let data_path = std::path::Path::new(&data_dir);
@@ -380,11 +380,11 @@ async fn main() -> anyhow::Result<()> {
let models_dir = data_path.join("models");
std::fs::create_dir_all(&models_dir)?;
- let onnx_url = model_url.as_deref()
+ let onnx_url = _model_url.as_deref()
.unwrap_or(open_ontologies::embed::BGE_SMALL_ONNX_URL);
- let tok_url = tokenizer_url.as_deref()
+ let tok_url = _tokenizer_url.as_deref()
.unwrap_or(open_ontologies::embed::BGE_SMALL_TOKENIZER_URL);
- let onnx_filename = model_name.as_deref()
+ let onnx_filename = _model_name.as_deref()
.unwrap_or("bge-small-en-v1.5.onnx");
let model_path = models_dir.join(onnx_filename);
diff --git a/src/server.rs b/src/server.rs
index 2eeba804..c17dffac 100644
--- a/src/server.rs
+++ b/src/server.rs
@@ -55,7 +55,7 @@ impl OpenOntologiesServer {
db: StateDb,
graph: Arc<GraphStore>,
governance_webhook: Option<String>,
- embed_config: crate::config::EmbeddingsConfig,
+ _embed_config: crate::config::EmbeddingsConfig,
) -> Self {
let lineage = crate::lineage::LineageLog::with_governance_webhook(db.clone(), governance_webhook.clone());
let session_id = lineage.new_session();
@@ -69,11 +69,11 @@ impl OpenOntologiesServer {
let default_model_dir = dirs::home_dir()
.map(|h| h.join(".open-ontologies/models"));
- let model_path = embed_config.model_path
+ let model_path = _embed_config.model_path
.map(|p| std::path::PathBuf::from(crate::config::expand_tilde(&p)))
.or_else(|| default_model_dir.as_ref().map(|d| d.join("bge-small-en-v1.5.onnx")));
- let tokenizer_path = embed_config.tokenizer_path
+ let tokenizer_path = _embed_config.tokenizer_path
.map(|p| std::path::PathBuf::from(crate::config::expand_tilde(&p)))
.or_else(|| default_model_dir.as_ref().map(|d| d.join("tokenizer.json")));