Skip to content

Can not be indexed by u32 #200

Open
Open
@amyipdev

Description

@amyipdev

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?

Activity

karx1

karx1 commented on Oct 18, 2021

@karx1

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @amyipdev@karx1

        Issue actions

          Can not be indexed by u32 · Issue #200 · maciejhirsz/json-rust