Skip to content

Commit

Permalink
chore: deduplicate compile_program and compile_contract methods (#…
Browse files Browse the repository at this point in the history
…4098)

# Description

## Problem\*

Resolves partially #3503

## Summary\*

This PR removes some duplication on the compilation methods

## Additional Context



## Documentation\*

Check one:
- [x] No documentation needed.
- [ ] Documentation included in this PR.
- [ ] **[Exceptional Case]** Documentation to be submitted in a separate
PR.

# PR Checklist\*

- [x] I have tested the changes locally.
- [x] I have formatted the changes with [Prettier](https://prettier.io/)
and/or `cargo fmt` on default settings.
  • Loading branch information
TomAFrench authored Jan 19, 2024
1 parent 74406ac commit 6001b01
Show file tree
Hide file tree
Showing 15 changed files with 95 additions and 265 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

171 changes: 44 additions & 127 deletions tooling/backend_interface/test-binaries/mock_backend/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 0 additions & 8 deletions tooling/lsp/src/requests/profile_run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,20 +58,12 @@ fn on_profile_run_request_inner(
// Since we filtered on crate name, this should be the only item in the iterator
match workspace.into_iter().next() {
Some(_package) => {
let (binary_packages, contract_packages): (Vec<_>, Vec<_>) = workspace
.into_iter()
.filter(|package| !package.is_library())
.cloned()
.partition(|package| package.is_binary());

let expression_width = ExpressionWidth::Bounded { width: 3 };

let (compiled_programs, compiled_contracts) = nargo::ops::compile_workspace(
&workspace_file_manager,
&parsed_files,
&workspace,
&binary_packages,
&contract_packages,
expression_width,
&CompileOptions::default(),
)
Expand Down
Loading

0 comments on commit 6001b01

Please sign in to comment.