Rename the helpful variant, AttributeBuilder::new, to AttributeBuilder::helpful. (#625) r=nalexander
This commit is contained in:
parent
ca451a7c9c
commit
9cc5cbf288
4 changed files with 12 additions and 12 deletions
|
@ -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()
|
||||
|
|
10
src/conn.rs
10
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()),
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue