Skip to content

Improvement: Add type annotations to improve code readability #3

Description

@Tahaa-Dev

Most of the ResExt proc-macro (resext-macro crate in resext-macro/src/lib.rs) has no type annotations, which can make code ambiguous and reduce readability, as this snippet:

let alias = args.alias.unwrap_or_else(|| {
    String::from("Res")
});
let alias = quote::format_ident!("{}", alias);

can be ambiguous, while this snippet:

let alias: String = args.alias.unwrap_or_else(|| {
    String::from("Res")
});
let alias: proc_macro2::Ident = quote::format_ident!("{}", alias);

is much more readable especially to new contributors

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions