Skip to content
This repository was archived by the owner on Dec 1, 2023. It is now read-only.
This repository was archived by the owner on Dec 1, 2023. It is now read-only.

Bug: nested list deserialization is not working #12

@josecelano

Description

@josecelano

Relates to: torrust/torrust-index#266

There is a failing test:

#[test]
fn deserialize_to_nested_list() {
    // [
    //   [
    //     "188.163.121.224",
    //     56711
    //   ],
    //   [
    //     "162.250.131.26",
    //     13386
    //   ]
    // ]

    #[derive(PartialEq, Debug, Deserialize)]
    struct Item {
        ip: String,
        port: i64,
    }

    let b = "d1:0l15:188.163.121.224i56711ee1:1l14:162.250.131.26i13386eee";

    let r: Vec<Item> = from_str(b).unwrap();

    assert_eq!(
        r,
        vec![
            Item {
                ip: "188.163.121.224".to_string(),
                port: 56711
            },
            Item {
                ip: "162.250.131.26".to_string(),
                port: 13386
            }
        ]
    );
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions