Skip to content

Commit 237ec4b

Browse files
committed
Adjust path names
1 parent 4f2c04e commit 237ec4b

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

crate/src/paths.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1+
pub const ANCHOR_LANG_ACCOUNT: [&str; 4] = ["anchor_lang", "accounts", "account", "Account"];
12
pub const ANCHOR_LANG_CONTEXT: [&str; 3] = ["anchor_lang", "context", "Context"];
23
pub const ANCHOR_LANG_SIGNER: [&str; 4] = ["anchor_lang", "accounts", "signer", "Signer"];
4+
pub const ANCHOR_LANG_DISCRIMINATOR_TRAIT: [&str; 2] = ["anchor_lang", "Discriminator"];
5+
pub const ANCHOR_LANG_TRY_DESERIALIZE: [&str; 3] =
6+
["anchor_lang", "AccountDeserialize", "try_deserialize"];
7+
8+
pub const BORSH_TRY_FROM_SLICE: [&str; 4] = ["borsh", "de", "BorshDeserialize", "try_from_slice"];
39

410
pub const SOLANA_PROGRAM_ACCOUNT_INFO: [&str; 3] =
511
["solana_program", "account_info", "AccountInfo"];
6-
pub const BORSH_TRY_FROM_SLICE: [&str; 4] = ["borsh", "de", "BorshDeserialize", "try_from_slice"];
7-
pub const ANCHOR_ACCOUNT: [&str; 4] = ["anchor_lang", "accounts", "account", "Account"];
8-
pub const ANCHOR_DISCRIMINATOR_TRAIT: [&str; 2] = ["anchor_lang", "Discriminator"];
9-
pub const ANCHOR_TRY_DESERIALIZE: [&str; 3] =
10-
["anchor_lang", "AccountDeserialize", "try_deserialize"];

lints/type_cosplay/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,10 @@ impl<'tcx> LateLintPass<'tcx> for TypeCosplay {
8888
let middle_ty = cx.tcx.type_of(def_id);
8989
then {
9090
if_chain! {
91-
if let Some(trait_did) = get_trait_def_id(cx, &paths::ANCHOR_DISCRIMINATOR_TRAIT);
91+
if let Some(trait_did) = get_trait_def_id(cx, &paths::ANCHOR_LANG_DISCRIMINATOR_TRAIT);
9292
if implements_trait(cx, middle_ty, trait_did, &[]);
9393
if let Some(def_id) = cx.typeck_results().type_dependent_def_id(fnc_expr.hir_id);
94-
if !match_def_path(cx, def_id, &paths::ANCHOR_TRY_DESERIALIZE);
94+
if !match_def_path(cx, def_id, &paths::ANCHOR_LANG_TRY_DESERIALIZE);
9595
then {
9696
span_lint_and_help(
9797
cx,

0 commit comments

Comments
 (0)