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

[Feature request] Arithmetic Operations #23

Open
JoshuaVandaele opened this issue Dec 17, 2023 · 1 comment
Open

[Feature request] Arithmetic Operations #23

JoshuaVandaele opened this issue Dec 17, 2023 · 1 comment

Comments

@JoshuaVandaele
Copy link

Hey,

I've been finding myself using this crate for a personal project, however a current struggle is to add Bytes together (I currently use get_bytes to addition them), however, it'd be great if we'd be able to simply add those two together:

let byte1 = Byte::from(10)
let byte2 = Byte::from(20)
let byte3 = byte1 + byte2 // Currently doesn't work
@magiclen
Copy link
Owner

Every operation should be checked to prevent panic or incorrect result. You can use the add method.

let byte3 = byte1.add(byte2).unwrap();

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

No branches or pull requests

2 participants