Skip to content

Make calls to trait methods fully qualified in acl plugin#21

Merged
mfornet merged 2 commits into
near:masterfrom
mooori:acl-use-stmts
Oct 18, 2022
Merged

Make calls to trait methods fully qualified in acl plugin#21
mfornet merged 2 commits into
near:masterfrom
mooori:acl-use-stmts

Conversation

@mooori
Copy link
Copy Markdown
Contributor

@mooori mooori commented Oct 17, 2022

Previously contract developers needed to bring traits into scope to allow the code generated for acl to call methods of some traits:

  • std::convert::TryFrom for method try_from
  • near_plugins::events::AsEvent for method emit

In this PR, calls to above methods are changed to fully qualified syntax. As a result, the traits no longer need to be brought into scope with use statements.

@mooori mooori changed the title Acl use stmts Make calls to trait methods fully qualified in acl plugin Oct 17, 2022
@@ -1,10 +1,8 @@
use near_plugins::events::AsEvent;
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll no longer need to ask contract developers to do this (same for TryFrom below).

@mooori mooori marked this pull request as ready for review October 17, 2022 15:29
@mooori mooori requested a review from mfornet October 17, 2022 15:29
@mfornet mfornet merged commit 4be85a9 into near:master Oct 18, 2022
@mooori mooori deleted the acl-use-stmts branch October 19, 2022 06:45
This was referenced Mar 27, 2026
@github-actions github-actions Bot mentioned this pull request Apr 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants