diff --git a/src/morethantext/fieldtype.rs b/src/morethantext/fieldtype.rs index 6b79eca..ec20675 100644 --- a/src/morethantext/fieldtype.rs +++ b/src/morethantext/fieldtype.rs @@ -19,9 +19,9 @@ pub struct StaticString { } impl StaticString { - pub fn new(data: &str) -> FieldType { + pub fn new() -> FieldType { FieldType::StaticString(Self { - data: data.to_string(), + data: "".to_string(), }) } } @@ -38,13 +38,10 @@ mod staticstrings { #[test] fn create_static_string() { - let data = "fred"; - let field = StaticString::new(data); + let field = StaticString::new(); assert!( - field.to_string() == data, - "\n\nGot: {}\nWant: {}\n\n", - field.to_string(), - data + field.to_string() == "", + "New should return an empty string." ); } } diff --git a/src/morethantext/mod.rs b/src/morethantext/mod.rs index a6879f3..7f9936c 100644 --- a/src/morethantext/mod.rs +++ b/src/morethantext/mod.rs @@ -237,8 +237,8 @@ mod records { async fn update_fields() { let rec = Record::new(); let name = "elephant"; - let data = "Something to remember."; - let sstr = StaticString::new(data); + let data = ""; + let sstr = StaticString::new(); rec.update_field(name.to_string(), sstr).await; let output = rec.get_field(name).await.unwrap(); assert!(