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

223 implement assetsread and assetsread bytes #225

Merged
merged 7 commits into from
Jul 22, 2023

Conversation

hulto
Copy link
Collaborator

@hulto hulto commented Jul 9, 2023

What type of PR is this?

/kind feature
/kind eldritch-function

What this PR does / why we need it:

This PR provides the ability to read files from memory and be used by in memory processes.

Which issue(s) this PR fixes:

Fixes #223

@hulto hulto linked an issue Jul 9, 2023 that may be closed by this pull request
@hulto hulto added eldritch Related to the Eldritch language feature New feature or request labels Jul 9, 2023
@codecov
Copy link

codecov bot commented Jul 9, 2023

Codecov Report

Merging #225 (3b9b2bc) into main (bc4c246) will increase coverage by 0.08%.
The diff coverage is 85.71%.

@@            Coverage Diff             @@
##             main     #225      +/-   ##
==========================================
+ Coverage   74.76%   74.85%   +0.08%     
==========================================
  Files          85       87       +2     
  Lines        4993     5034      +41     
==========================================
+ Hits         3733     3768      +35     
- Misses       1174     1180       +6     
  Partials       86       86              
Impacted Files Coverage Δ
implants/lib/eldritch/src/assets.rs 51.28% <50.00%> (-0.34%) ⬇️
implants/lib/eldritch/src/assets/read_impl.rs 93.75% <93.75%> (ø)
...plants/lib/eldritch/src/assets/read_binary_impl.rs 94.11% <94.11%> (ø)
implants/lib/eldritch/src/lib.rs 92.22% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Collaborator

@Cictrone Cictrone left a comment

Choose a reason for hiding this comment

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

lgtm, one comment about efficiency

};
let mut result = String::new();
for byte in src_file_bytes.iter() {
result.push(*byte as char);
Copy link
Collaborator

Choose a reason for hiding this comment

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

this seems sooooooo slow lol, is there no faster way?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Not sure this is faster.
little harder to read but:

let res = src_file_bytes.iter().map(|x| *x as u32).collect::<Vec<u32>>();

@hulto hulto merged commit 24a7a08 into main Jul 22, 2023
8 checks passed
@hulto hulto deleted the 223-implement-assetsread-and-assetsread_bytes branch July 22, 2023 21:55
hulto added a commit that referenced this pull request Sep 30, 2023
* Impl, test, and docs.

* read binary impl, test, and docs.

* update lib test.

* Fix test?

* Might be faster.
KCarretto pushed a commit that referenced this pull request Feb 1, 2024
 
223 implement assetsread and assetsread bytes (#225)

* Impl, test, and docs.

* read binary impl, test, and docs.

* update lib test.

* Fix test?

* Might be faster.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
eldritch Related to the Eldritch language feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement assets.read and assets.read_bytes
2 participants