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

Two funds can have the same name, rendering one or the other inaccessible #9

Closed
leggettc18 opened this issue Jun 7, 2019 · 5 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@leggettc18
Copy link
Owner

In GitLab by @leggettc18 on Sep 28, 2018, 20:43

I didn't add any way to make sure fund names are unique upon creation, so two funds with the same name can be added. The get_by_name function returns only one, whichever one it finds first, rendering one or the other inaccessible depending on how the Fund Vector is sorted. Implementing PartialEq on Fund would allow to check if a fund by the name already exists in the Fund Vector before adding it, and the Fund::new() function can return an error if it does.

@leggettc18 leggettc18 added this to the 1.0.0 milestone Jun 7, 2019
@leggettc18 leggettc18 self-assigned this Jun 7, 2019
@leggettc18 leggettc18 added the bug Something isn't working label Jun 7, 2019
@leggettc18
Copy link
Owner Author

In GitLab by @leggettc18 on Sep 28, 2018, 20:49

I just realized Fund::new() has no way of checking the Fund Vector. Perhaps the best way to fix this is to create a sort of FundManager struct that holds the Fund Vector and abstracts some of Fund's functionality.

@leggettc18
Copy link
Owner Author

In GitLab by @leggettc18 on Sep 28, 2018, 23:32

mentioned in commit e656b84

@leggettc18
Copy link
Owner Author

In GitLab by @leggettc18 on Sep 28, 2018, 23:32

mentioned in commit 81bb656

@leggettc18
Copy link
Owner Author

In GitLab by @leggettc18 on Sep 28, 2018, 23:32

mentioned in commit f643499

@leggettc18
Copy link
Owner Author

In GitLab by @leggettc18 on Sep 28, 2018, 23:46

closed

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
None yet
Development

No branches or pull requests

1 participant