Skip to content

Commit

Permalink
fix: rename typename's to_snake_case to to_snake_case_ident
Browse files Browse the repository at this point in the history
  • Loading branch information
mbrobbel committed Sep 20, 2022
1 parent 3b717dc commit 05352b1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions pbjson-build/src/descriptor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ pub struct Package {

impl Display for Package {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
write!(f, "{}", self.path[0].to_snake_case())?;
write!(f, "{}", self.path[0].to_snake_case_ident())?;
for element in &self.path[1..self.path.len()] {
write!(f, ".{}", element.to_snake_case())?;
write!(f, ".{}", element.to_snake_case_ident())?;
}
Ok(())
}
Expand Down Expand Up @@ -68,7 +68,7 @@ impl TypeName {
Self(s)
}

pub fn to_snake_case(&self) -> String {
pub fn to_snake_case_ident(&self) -> String {
use heck::ToSnakeCase;
escape_ident(self.0.to_snake_case())
}
Expand Down
2 changes: 1 addition & 1 deletion pbjson-build/src/resolver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ impl<'a> Resolver<'a> {
while let Some(i) = iter.next() {
match iter.peek() {
Some(_) => {
ret.push_str(i.to_snake_case().as_str());
ret.push_str(i.to_snake_case_ident().as_str());
ret.push_str("::");
}
None => {
Expand Down

0 comments on commit 05352b1

Please sign in to comment.