Skip to content

Commit 54aded1

Browse files
committed
Fix lint errors for codegen
Fix clippy lint errors for rust 1.67 for codegen Signed-off-by: James Sturtevant <jstur@microsoft.com>
1 parent 2e84ff6 commit 54aded1

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

ttrpc-codegen/src/convert.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ trait ProtobufOptions {
4141
impl<'a> ProtobufOptions for &'a [model::ProtobufOption] {
4242
fn by_name(&self, name: &str) -> Option<&model::ProtobufConstant> {
4343
let option_name = name;
44-
for &model::ProtobufOption {
45-
ref name,
46-
ref value,
44+
for model::ProtobufOption {
45+
name,
46+
value,
4747
} in *self
4848
{
4949
if name == option_name {
@@ -224,7 +224,7 @@ impl AbsolutePath {
224224
} else {
225225
assert!(!path.starts_with('.'));
226226
assert!(!path.ends_with('.'));
227-
AbsolutePath::new(format!(".{}", path))
227+
AbsolutePath::new(format!(".{path}"))
228228
}
229229
}
230230

@@ -396,7 +396,7 @@ struct Resolver<'a> {
396396

397397
impl<'a> Resolver<'a> {
398398
fn map_entry_name_for_field_name(field_name: &str) -> String {
399-
format!("{}_MapEntry", field_name)
399+
format!("{field_name}_MapEntry")
400400
}
401401

402402
fn map_entry_field(
@@ -964,7 +964,7 @@ impl<'a> Resolver<'a> {
964964
v.map_err(|()| {
965965
ConvertError::UnsupportedExtensionType(
966966
option_name.to_owned(),
967-
format!("{:?}", field_type),
967+
format!("{field_type:?}"),
968968
)
969969
})
970970
}

ttrpc-codegen/src/parser.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -912,7 +912,7 @@ impl<'a> Parser<'a> {
912912

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

0 commit comments

Comments
 (0)