Skip to content

Commit bcd9b23

Browse files
committed
Update serde json, fix couple of bugs
Fix bug in some cases when parsing api resonse due to CharacterStatsData have wrong data type. Fixed crash that could occur in verbose mode if http response contained unicode characters. Update serde json
1 parent 53bbf61 commit bcd9b23

File tree

11 files changed

+43
-31
lines changed

11 files changed

+43
-31
lines changed

RELEASE.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# dcli Release Notes
22

3+
## v0.8.4 August 1, 2022
4+
5+
- Fixed data parsing error that could occur due to wrong data type in code
6+
- Fixed crash that could occur in verbose mode with http responses containing unicode characters.
7+
38
## v0.8.3 July 7, 2022
49

510
- Fixed crashed when viewing an activity using Glaives. Thank you @BinarMorker!

src/Cargo.lock

Lines changed: 21 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/dcli/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "dcli"
33
#version
4-
version = "0.8.3"
4+
version = "0.8.4"
55
authors = ["Mike Chambers <mikechambers@gmail.com>"]
66
edition = "2018"
77
description = "Library for the dcli collection of command line tools for Destiny 2."
@@ -16,7 +16,7 @@ readme = "README.md"
1616
reqwest = { version="0.11.4"}
1717
serde = "1.0.126"
1818
serde_derive = "1.0.126"
19-
serde_json = "1.0.64"
19+
serde_json = "1.0.82"
2020
serde_repr = "0.1.7"
2121
zip = "0.5.13"
2222
chrono = "0.4.19"

src/dcli/src/apiclient.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,12 @@ impl ApiClient {
9797
const MAX: usize = 200;
9898
let limit = std::cmp::min(len, MAX);
9999

100+
let string: String = body.chars().take(limit).skip(0).collect();
100101
println!(
101102
"---------Begin API response : First {} chars---------",
102103
limit
103104
);
104-
println!("{}", &body[..limit]);
105+
println!("{}", string);
105106
println!("---------End API response---------");
106107
}
107108

src/dcli/src/response/character.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -69,23 +69,23 @@ pub struct CharacterData {
6969
#[derive(PartialEq, Eq, Serialize, Deserialize, Debug, Clone)]
7070
pub struct CharacterStatsData {
7171
#[serde(rename = "1935470627")]
72-
pub power: u32,
72+
pub power: i32,
7373

7474
#[serde(rename = "2996146975")]
75-
pub mobility: u32,
75+
pub mobility: i32,
7676

7777
#[serde(rename = "392767087")]
78-
pub resilience: u32,
78+
pub resilience: i32,
7979

8080
#[serde(rename = "1943323491")]
81-
pub recovery: u32,
81+
pub recovery: i32,
8282

8383
#[serde(rename = "1735777505")]
84-
pub discipline: u32,
84+
pub discipline: i32,
8585

8686
#[serde(rename = "144602215")]
87-
pub intellect: u32,
87+
pub intellect: i32,
8888

8989
#[serde(rename = "4244567218")]
90-
pub strength: u32,
90+
pub strength: i32,
9191
}

src/dclia/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "dclia"
33
#version
4-
version = "0.8.3"
4+
version = "0.8.4"
55
authors = ["Mike Chambers <mikechambers@gmail.com>"]
66
description = "Command line tool for retrieving information on current activity for specified player character."
77
homepage = "https://www.mikechambers.com"

src/dcliad/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "dcliad"
33
#version
4-
version = "0.8.3"
4+
version = "0.8.4"
55
authors = ["Mike Chambers <mikechambers@gmail.com>"]
66
edition = "2018"
77
description = "Command line tool for viewing Destiny 2 activity details."

src/dcliah/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "dcliah"
33
#version
4-
version = "0.8.3"
4+
version = "0.8.4"
55
authors = ["Mike Chambers <mikechambers@gmail.com>"]
66
edition = "2018"
77
description = "Command line tool for viewing Destiny 2 activity history."

src/dclim/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "dclim"
33
#version
4-
version = "0.8.3"
4+
version = "0.8.4"
55
authors = ["Mike Chambers <mikechambers@gmail.com>"]
66
edition = "2018"
77
description = "Command line tool for managing and syncing the remote Destiny 2 API manifest database."

src/dclisync/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "dclisync"
33
#version
4-
version = "0.8.3"
4+
version = "0.8.4"
55
authors = ["Mike Chambers <mikechambers@gmail.com>"]
66
edition = "2018"
77
description = "Command line tool for downloading and syncing Destiny 2 Crucible activity history."

0 commit comments

Comments
 (0)