Skip to content

Commit

Permalink
Add docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew committed Jan 6, 2024
1 parent 157b45f commit d09893e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions google-apis-common/src/field_mask.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
Expand Down

0 comments on commit d09893e

Please sign in to comment.