summaryrefslogtreecommitdiffstats
path: root/src/schema/value.rs
diff options
context:
space:
mode:
authorPaul Masurel <paul.masurel@gmail.com>2018-09-11 09:45:27 +0900
committerPaul Masurel <paul.masurel@gmail.com>2018-09-11 09:45:27 +0900
commit63868733a38fa57fccf3d2e6e52ae1c5462a01ba (patch)
tree1f91f520ae4c84ec92c7893d630607cf2dbe2de6 /src/schema/value.rs
parent644d8a3a10bd6ad292360562e6c6a302bb709f78 (diff)
Added SnippetGenerator
Diffstat (limited to 'src/schema/value.rs')
-rw-r--r--src/schema/value.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/schema/value.rs b/src/schema/value.rs
index f5ce151..64b0dc7 100644
--- a/src/schema/value.rs
+++ b/src/schema/value.rs
@@ -74,10 +74,10 @@ impl Value {
///
/// # Panics
/// If the value is not of type `Str`
- pub fn text(&self) -> &str {
+ pub fn text(&self) -> Option<&str> {
match *self {
- Value::Str(ref text) => text,
- _ => panic!("This is not a text field."),
+ Value::Str(ref text) => Some(text),
+ _ => None,
}
}