Skip to content

Commit

Permalink
Fix clippy lint errors for rust 1.67 for codegen
Browse files Browse the repository at this point in the history
Signed-off-by: James Sturtevant <jstur@microsoft.com>
  • Loading branch information
jsturtevant committed Jan 29, 2023
1 parent 2ab948b commit 60d4be4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions ttrpc-codegen/src/convert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ trait ProtobufOptions {
impl<'a> ProtobufOptions for &'a [model::ProtobufOption] {
fn by_name(&self, name: &str) -> Option<&model::ProtobufConstant> {
let option_name = name;
for &model::ProtobufOption {
ref name,
ref value,
for model::ProtobufOption {
name,
value,
} in *self
{
if name == option_name {
Expand Down Expand Up @@ -224,7 +224,7 @@ impl AbsolutePath {
} else {
assert!(!path.starts_with('.'));
assert!(!path.ends_with('.'));
AbsolutePath::new(format!(".{}", path))
AbsolutePath::new(format!(".{path}"))
}
}

Expand Down Expand Up @@ -396,7 +396,7 @@ struct Resolver<'a> {

impl<'a> Resolver<'a> {
fn map_entry_name_for_field_name(field_name: &str) -> String {
format!("{}_MapEntry", field_name)
format!("{field_name}_MapEntry")
}

fn map_entry_field(
Expand Down Expand Up @@ -964,7 +964,7 @@ impl<'a> Resolver<'a> {
v.map_err(|()| {
ConvertError::UnsupportedExtensionType(
option_name.to_owned(),
format!("{:?}", field_type),
format!("{field_type:?}"),
)
})
}
Expand Down
2 changes: 1 addition & 1 deletion ttrpc-codegen/src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -912,7 +912,7 @@ impl<'a> Parser<'a> {

fn next_ident_if_in(&mut self, idents: &[&str]) -> ParserResult<Option<String>> {
let v = match self.lookahead()? {
Some(&Token::Ident(ref next)) => {
Some(Token::Ident(next)) => {
if idents.iter().any(|i| i == next) {
next.clone()
} else {
Expand Down

0 comments on commit 60d4be4

Please sign in to comment.