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

Update wiring 0.2.0 #79

Merged
merged 2 commits into from
Apr 27, 2024
Merged

Update wiring 0.2.0 #79

merged 2 commits into from
Apr 27, 2024

Conversation

louaykamel
Copy link
Contributor

Hi David,

The new wiring 0.2 is huge milestone. ~ 10x improvement.

@@ -22,7 +22,7 @@ use rand::Rng;
#[cfg(feature = "rkyv")]
use rkyv::Archived;
#[cfg(feature = "wiring")]
use wiring::prelude::{Unwiring, Wiring};
use wiring::prelude::{concat_end, concat_mid, concat_start, Unwiring, Wiring};
Copy link
Owner

Choose a reason for hiding this comment

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

These concat_* includes aren't necessary since they're attributes available to your derive. It should still compile fine if you remove them (but keep the conditional attributes on the fields).

Comment on lines 9 to 10
let mut wire: Vec<u8> = Vec::new();
wire.reserve(BUFFER_LEN); // Optional
Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change
let mut wire: Vec<u8> = Vec::new();
wire.reserve(BUFFER_LEN); // Optional
let mut wire = Vec::<u8>::with_capacity(BUFFER_LEN);

src/bench_wiring.rs Outdated Show resolved Hide resolved
src/bench_wiring.rs Show resolved Hide resolved
@@ -61,8 +61,11 @@ use crate::Generate;
#[cfg_attr(feature = "nanoserde", derive(nanoserde::SerBin, nanoserde::DeBin))]
#[cfg_attr(feature = "wiring", derive(Wiring, Unwiring))]
pub struct Vector3 {
#[cfg_attr(feature = "wiring", concat_start)]
Copy link
Owner

Choose a reason for hiding this comment

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

[nonblocking] Suggestion: a concat_all attribute on the type could be a nice way to tidy some of these structs up.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed, the ultimate plan to remove them all by making derive macro smarter.

Please put this merge on hold, I will see if I can tackle it tomorrow or during the weekend.

@louaykamel
Copy link
Contributor Author

I have implemented the recommended modifications. Kindly review and inform me if there are any omissions or if additional adjustments are desired.

Copy link
Owner

@djkoloski djkoloski left a comment

Choose a reason for hiding this comment

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

LGTM

@djkoloski djkoloski merged commit ccc7749 into djkoloski:master Apr 27, 2024
1 check passed
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