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

fix(gadget-blueprint-serde)!: handle bytes properly #500

Merged
merged 4 commits into from
Nov 26, 2024

Conversation

Serial-ATA
Copy link
Contributor

With Field::List and Field::Bytes being distinct types, we'll have to rely on serde_bytes::ByteBuf to call the serialize_byte_buf method. That means any job returning Vec<u8> should now return ByteBuf, which has been re-exported in the SDK.

Simply:

fn my_job() -> Result<Vec<u8>> {
	Ok(some_vec)
}

To:

use gadget_sdk::ByteBuf;

fn my_job() -> Result<ByteBuf> {
	Ok(some_vec.into())
}

@Serial-ATA Serial-ATA added the bug 🪲 Something isn't working label Nov 26, 2024
@Serial-ATA Serial-ATA force-pushed the serial/blueprint-serde-bytes branch from 56f0827 to 5d3e8a7 Compare November 26, 2024 16:53
Copy link
Contributor

@shekohex shekohex left a comment

Choose a reason for hiding this comment

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

Looks good

Cargo.toml Outdated Show resolved Hide resolved
@Serial-ATA Serial-ATA force-pushed the serial/blueprint-serde-bytes branch from 5d3e8a7 to 8015c9a Compare November 26, 2024 17:50
@Serial-ATA Serial-ATA requested a review from shekohex November 26, 2024 17:50
@drewstone drewstone merged commit 042718b into main Nov 26, 2024
13 checks passed
@webb-spider webb-spider bot mentioned this pull request Nov 26, 2024
@Serial-ATA Serial-ATA deleted the serial/blueprint-serde-bytes branch November 26, 2024 20:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🪲 Something isn't working
Projects
Status: Completed ✅
Development

Successfully merging this pull request may close these issues.

3 participants