Add docstring

This commit is contained in:
andrew
2024-01-06 18:57:31 +09:00
parent 157b45f606
commit d09893e921

View File

@@ -35,6 +35,8 @@ fn snakecase(source: &str) -> String {
pub struct FieldMask(Vec<String>);
impl FieldMask {
/// Create a new `FieldMask` from a list of paths. These are converted to snake
/// case if they aren't already.
pub fn new<S: AsRef<str>>(values: &[S]) -> Self {
return Self(values.iter().map(|s| snakecase(s.as_ref())).collect());
}