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.
This commit is contained in:
Mauri de Souza Nunes
2019-02-27 21:23:00 -03:00
committed by Paul Masurel
parent a814a31f1e
commit ec73a9a284

View File

@@ -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<Field> {
self.0.fields_map.get(field_name).cloned()
}