diff --git a/db/src/schema.rs b/db/src/schema.rs index 48942006..96707c3b 100644 --- a/db/src/schema.rs +++ b/db/src/schema.rs @@ -84,7 +84,7 @@ pub struct AttributeBuilder { impl AttributeBuilder { /// Make a new AttributeBuilder for human consumption: it will help you /// by flipping relevant flags. - pub fn new() -> Self { + pub fn helpful() -> Self { AttributeBuilder { helpful: true, ..Default::default() diff --git a/src/conn.rs b/src/conn.rs index 46f8a062..24838121 100644 --- a/src/conn.rs +++ b/src/conn.rs @@ -1511,25 +1511,25 @@ mod tests { version: 1, attributes: vec![ (kw!(:todo/uuid), - AttributeBuilder::new() + AttributeBuilder::helpful() .value_type(ValueType::Uuid) .multival(false) .unique(Unique::Value) .index(true) .build()), (kw!(:todo/name), - AttributeBuilder::new() + AttributeBuilder::helpful() .value_type(ValueType::String) .multival(false) .fulltext(true) .build()), (kw!(:todo/completion_date), - AttributeBuilder::new() + AttributeBuilder::helpful() .value_type(ValueType::Instant) .multival(false) .build()), (kw!(:label/name), - AttributeBuilder::new() + AttributeBuilder::helpful() .value_type(ValueType::String) .multival(false) .unique(Unique::Value) @@ -1537,7 +1537,7 @@ mod tests { .index(true) .build()), (kw!(:label/color), - AttributeBuilder::new() + AttributeBuilder::helpful() .value_type(ValueType::String) .multival(false) .build()), diff --git a/src/vocabulary.rs b/src/vocabulary.rs index cf94aa38..4b73a53d 100644 --- a/src/vocabulary.rs +++ b/src/vocabulary.rs @@ -66,7 +66,7 @@ //! version: 1, //! attributes: vec![ //! (kw!(:link/title), -//! vocabulary::AttributeBuilder::new() +//! vocabulary::AttributeBuilder::helpful() //! .value_type(ValueType::String) //! .multival(false) //! .fulltext(true) diff --git a/tests/vocabulary.rs b/tests/vocabulary.rs index 7e3b46d9..ca5257e2 100644 --- a/tests/vocabulary.rs +++ b/tests/vocabulary.rs @@ -64,13 +64,13 @@ lazy_static! { version: 1, attributes: vec![ (FOO_NAME.clone(), - vocabulary::AttributeBuilder::new() + vocabulary::AttributeBuilder::helpful() .value_type(ValueType::String) .multival(false) .unique(vocabulary::attribute::Unique::Identity) .build()), (FOO_MOMENT.clone(), - vocabulary::AttributeBuilder::new() + vocabulary::AttributeBuilder::helpful() .value_type(ValueType::Instant) .multival(false) .index(true) @@ -131,7 +131,7 @@ fn test_default_attributebuilder_complains() { .validate(|| "Foo".to_string()) .is_err()); - assert!(vocabulary::AttributeBuilder::new() + assert!(vocabulary::AttributeBuilder::helpful() .value_type(ValueType::String) .multival(true) .fulltext(true) @@ -142,12 +142,12 @@ fn test_default_attributebuilder_complains() { #[test] fn test_add_vocab() { - let bar = vocabulary::AttributeBuilder::new() + let bar = vocabulary::AttributeBuilder::helpful() .value_type(ValueType::Instant) .multival(false) .index(true) .build(); - let baz = vocabulary::AttributeBuilder::new() + let baz = vocabulary::AttributeBuilder::helpful() .value_type(ValueType::String) .multival(true) .fulltext(true)