Skip to content

Commit c19469c

Browse files
committed
removed unecessary defaulting functionality
1 parent 503d622 commit c19469c

File tree

2 files changed

+1
-14
lines changed

2 files changed

+1
-14
lines changed

src/base/spec.rs

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -406,16 +406,6 @@ impl VectorIndexMethod {
406406
Self::IvfFlat { .. } => "IvfFlat",
407407
}
408408
}
409-
410-
pub fn is_default(&self) -> bool {
411-
matches!(
412-
self,
413-
Self::Hnsw {
414-
m: None,
415-
ef_construction: None,
416-
}
417-
)
418-
}
419409
}
420410

421411
impl fmt::Display for VectorIndexMethod {
@@ -458,9 +448,6 @@ impl fmt::Display for VectorIndexDef {
458448
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
459449
match &self.method {
460450
None => write!(f, "{}:{}", self.field_name, self.metric),
461-
Some(method) if method.is_default() => {
462-
write!(f, "{}:{}", self.field_name, self.metric)
463-
}
464451
Some(method) => write!(f, "{}:{}:{}", self.field_name, self.metric, method),
465452
}
466453
}

src/ops/targets/postgres.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,7 @@ fn to_vector_index_name(table_name: &str, vector_index_def: &spec::VectorIndexDe
501501
vector_index_def.field_name,
502502
to_vector_similarity_metric_sql(vector_index_def.metric)
503503
);
504-
if let Some(method) = vector_index_def.method.as_ref().filter(|m| !m.is_default()) {
504+
if let Some(method) = vector_index_def.method.as_ref() {
505505
name.push_str("__");
506506
name.push_str(&method.kind().to_ascii_lowercase());
507507
}

0 commit comments

Comments
 (0)