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

Unintuitive error #84

Open
jawoznia opened this issue Nov 26, 2024 · 0 comments
Open

Unintuitive error #84

jawoznia opened this issue Nov 26, 2024 · 0 comments
Labels

Comments

@jawoznia
Copy link

jawoznia commented Nov 26, 2024

The error on missed & in the access method is very bloated and a little hard to read. This is not something that has to change, but I figured it's better to note it here.

+ let cw_storage = CwStorage(deps.storage);
+ let admins = ADMINS.access(&cw_storage).get()?;
- let cw_storage = CwStorage(deps.storage);
- let admins = ADMINS.access(cw_storage).get()?;

When the reference is omitted the error is as follows:

error[E0599]: the method `get` exists for struct `ItemAccess<CwEncoding, Vec<Addr>, StorageBranch<CwStorage<&dyn Storage>>>`, but its trait bounds were not satisfied
  --> src/contract.rs:54:48
   |
54 |         let admins = ADMINS.access(cw_storage).get();
   |                                                ^^^ method cannot be called due to unsatisfied trait bounds
   |
  ::: /home/jan/.cargo/registry/src/index.crates.io-6f17d22bba15001f/storey-0.3.0/src/storage/branch.rs:23:1
   |
23 | pub struct StorageBranch<S> {
   | --------------------------- doesn't satisfy `_: StorageBackend` or `_: Storage`
   |
   = note: the following trait bounds were not satisfied:
           `storey::storage::branch::StorageBranch<cw_storey::CwStorage<&dyn Storage>>: storey_storage::backend::StorageBackend`
           which is required by `storey::storage::branch::StorageBranch<cw_storey::CwStorage<&dyn Storage>>: storey_storage::storage::Storage`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant