Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor: Use borrowed types for arguments #269

Merged

Conversation

danielsn
Copy link
Contributor

@danielsn danielsn commented Jun 28, 2021

Description of changes:

As per https://rust-unofficial.github.io/patterns/idioms/coercion-arguments.html#use-borrowed-types-for-arguments we should prefer &[T] to &Vec<T> for function arguments. Doing so

Resolved issues:

Initial step on #270

Call-outs:

Testing:

  • How is this change tested? Existing tests

  • Is this a refactor change? Yes

Checklist

  • Each commit message has a non-empty body, explaining why the change was made
  • Methods or procedures are documented
  • Regression or unit tests are included, or existing tests cover the modified code
  • My PR is restricted to a single feature or bugfix

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses.

@avanhatt avanhatt requested review from avanhatt and removed request for avanhatt June 28, 2021 20:14
Copy link
Contributor

@avanhatt avanhatt left a comment

Choose a reason for hiding this comment

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

LGTM

@avanhatt
Copy link
Contributor

Actually, should we be doing this change for &mut Vec<T> args too?

@danielsn
Copy link
Contributor Author

Actually, should we be doing this change for &mut Vec<T> args too?

220 |                         fargs.push(index_param);
    |                               ^^^^ method not found in `&mut [expr::Expr]`

@adpaco-aws adpaco-aws merged commit c99c2fb into model-checking:main-153-2021-06-23 Jun 29, 2021
@zhassan-aws zhassan-aws mentioned this pull request Aug 6, 2021
4 tasks
@danielsn danielsn deleted the idiomatic-rust branch September 24, 2021 21:33
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