Skip to content

Possibility to use clippy disallowed_methods? #1

Description

@taladar

Similar libraries such as fserr can be used with clippy.toml settings like

disallowed-methods = [
    # Use fs_errr functions, so the filename is available in the error message
    { path = "std::fs::canonicalize", reason = "Use fs_err functions so the filename is available in the error message", replacement = "fs_err::canonicalize" },
    { path = "std::fs::copy", reason = "Use fs_err functions so the filename is available in the error message", replacement = "fs_err::copy" },
]

(and others for the other std:fs functions of course, this is just to demonstrate the idea). This then displays errors when you use the original method. There are similar features disallowed-macros,...

I am not sure if the regular arithmetic operators can be used here but it might be worth experimenting and perhaps working with the clippy developers to achieve a similar level of support to find spots where cadd can be used in existing code bases.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions