From ec73a9a284cc1938de3b747ec2e10a1e1eac34ce Mon Sep 17 00:00:00 2001 From: Mauri de Souza Nunes Date: Wed, 27 Feb 2019 21:23:00 -0300 Subject: [PATCH] Remove note about panicking in get_field docs (#503) Since get_field rely on calling get on the underlying InnerSchema HashMap it shouldn't fail if the field was not found, it simply returns None. --- src/schema/schema.rs | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/schema/schema.rs b/src/schema/schema.rs index 3255c8839..cf443ad82 100644 --- a/src/schema/schema.rs +++ b/src/schema/schema.rs @@ -178,15 +178,7 @@ impl Schema { SchemaBuilder::default() } - /// Returns the field options associated with a given name. - /// - /// # Panics - /// Panics if the field name does not exist. - /// It is meant as an helper for user who created - /// and control the content of their schema. - /// - /// If panicking is not an option for you, - /// you may use `get(&self, field_name: &str)`. + /// Returns the field option associated with a given name. pub fn get_field(&self, field_name: &str) -> Option { self.0.fields_map.get(field_name).cloned() }