mirror of
https://github.com/quickwit-oss/tantivy.git
synced 2026-05-28 06:00:40 +00:00
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:
committed by
Paul Masurel
parent
a814a31f1e
commit
ec73a9a284
@@ -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()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user