openmls icon indicating copy to clipboard operation
openmls copied to clipboard

Warnings in PoC code

Open yonas opened this issue 2 years ago • 1 comments

Describe the bug warning: using '.borrow()' on a double reference, which returns '&HashMap<Vec<u8>, Contact>' instead of borrowing the inner type --> cli/src/user.rs:333:40

To Reproduce Steps to reproduce the behavior:

  1. git clone...
  2. cargo build --release

Expected behavior No errors or warnings.

Actual behavior

$ cargo build release
...
warning: `openmls` (lib) generated 1 warning
   Compiling cli v0.1.0 (/git/openmls/cli)
warning: using `.borrow()` on a double reference, which returns `&HashMap<Vec<u8>, Contact>` instead of borrowing the inner type
   --> cli/src/user.rs:333:40
    |
333 |         for contact_id in self.contacts.borrow().keys() {
    |                                        ^^^^^^^^^
    |
    = note: `#[warn(suspicious_double_ref_op)]` on by default

Screenshots or debug log

Platform (please complete the following information):

  • OS & OS version: FreeBSD 13.2
  • x86_64
  • Version: 837c7a9

yonas avatar Jul 25 '23 20:07 yonas

Forgot to add this warning:

warning: private item shadows public glob re-export
  --> openmls/src/group/mod.rs:27:1
   |
27 | pub(crate) mod errors;
   | ^^^^^^^^^^^^^^^^^^^^^^
   |
note: the name `errors` in the type namespace is supposed to be publicly re-exported here
  --> openmls/src/group/mod.rs:37:9
   |
37 | pub use public_group::*;
   |         ^^^^^^^^^^^^^^^
note: but the private item here shadows it
  --> openmls/src/group/mod.rs:27:1
   |
27 | pub(crate) mod errors;
   | ^^^^^^^^^^^^^^^^^^^^^^
   = note: `#[warn(hidden_glob_reexports)]` on by default

yonas avatar Jul 25 '23 20:07 yonas

Closed via #1611.

raphaelrobert avatar Jul 11 '24 14:07 raphaelrobert