mirror of
https://github.com/lifegpc/pixiv_downloader.git
synced 2026-07-08 01:32:41 +08:00
fanbox api: item deserailze more data
This commit is contained in:
14
src/parser/json.rs
Normal file
14
src/parser/json.rs
Normal file
@@ -0,0 +1,14 @@
|
||||
use json::JsonValue;
|
||||
|
||||
pub fn parse_u64(data: &JsonValue) -> Option<u64> {
|
||||
match data.as_u64() {
|
||||
Some(num) => Some(num),
|
||||
None => match data.as_str() {
|
||||
Some(num) => match num.trim().parse::<u64>() {
|
||||
Ok(num) => Some(num),
|
||||
Err(_) => None,
|
||||
},
|
||||
None => None,
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -1,2 +1,3 @@
|
||||
pub mod description;
|
||||
pub mod json;
|
||||
pub mod metadata;
|
||||
|
||||
Reference in New Issue
Block a user