Skip to content

Accept slices to function calls #142

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

Merged
merged 1 commit into from
Sep 12, 2018
Merged

Conversation

OddBloke
Copy link
Collaborator

@@ -115,7 +115,7 @@ impl Compiler {
self.emit(Instruction::ReturnValue);
}

fn compile_statements(&mut self, statements: &Vec<ast::LocatedStatement>) {
fn compile_statements(&mut self, statements: &[ast::LocatedStatement]) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I assume this variation is better rust code, but still I feel like the Vec syntax is clearer. At least to me.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This allows non-Vec data structures which can produce slices for free to call the function with less overhead.

@windelbouwman windelbouwman merged commit 8a28d1f into RustPython:master Sep 12, 2018
@OddBloke OddBloke deleted the clippy branch September 12, 2018 18:17
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.

2 participants