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

Can not be indexed by u32 #200

Open
amyipdev opened this issue Apr 16, 2021 · 1 comment
Open

Can not be indexed by u32 #200

amyipdev opened this issue Apr 16, 2021 · 1 comment

Comments

@amyipdev
Copy link

Error:

error[E0277]: the type `JsonValue` cannot be indexed by `u32`
  --> src/lib.rs:65:12
   |
65 |     while !parsed["functions"][c].is_null() {
   |            ^^^^^^^^^^^^^^^^^^^^^^ `JsonValue` cannot be indexed by `u32`
   |
   = help: the trait `Index<u32>` is not implemented for `JsonValue`

I'm guessing a manually typed in number automatically converts itself to a compatible type for indexing?

@karx1
Copy link

karx1 commented Oct 18, 2021

Hi, JsonValue can only be indexed by usize.

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