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

Implement deref, derefmut and asref for currency #1

Merged
merged 2 commits into from
Apr 5, 2024

Conversation

ChrisSchinnerl
Copy link
Member

@ChrisSchinnerl ChrisSchinnerl commented Apr 5, 2024

That way Currency becomes nicer to use

@ChrisSchinnerl ChrisSchinnerl self-assigned this Apr 5, 2024
n8maninger
n8maninger previously approved these changes Apr 5, 2024
@n8maninger n8maninger dismissed their stale review April 5, 2024 13:56

Tests failing

@n8maninger
Copy link
Member

note: an implementation of Div might be missing for currency::Currency
--> src/currency.rs:13:1
|
13 | pub struct Currency(u128);
| ^^^^^^^^^^^^^^^^^^^ must implement Div
note: the trait Div must be implemented
--> /rustc/7cf61ebde7b22796c69757901dd346d0fe70bd97/library/core/src/ops/arith.rs:449:1

error[E0369]: cannot subtract currency::Currency from currency::Currency
--> src/currency.rs:300:61
|
300 | ("9.999999999999999999999999 SC", Currency::siacoins(10) - Currency::new(1)),

Copy link
Member

@n8maninger n8maninger left a comment

Choose a reason for hiding this comment

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

Arithmetic is failing

@ChrisSchinnerl
Copy link
Member Author

Arithmetic is failing

Damn and I felt so smart when cargo check was passing. Guess it doesn't build the tests.

@n8maninger n8maninger merged commit 15597ec into master Apr 5, 2024
1 check passed
@n8maninger n8maninger deleted the chris/deref-currency branch April 5, 2024 14:29
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