Git Product home page Git Product logo

beautiful-wallpaper-every-day's People

Contributors

davidde avatar faebser avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

beautiful-wallpaper-every-day's Issues

Panic: duplicate field `user`

$ cargo run
XDG_PICTURES_DIR is "/home/wmoore"
wrote faulty json to "jsons/h6dT4DJ80n"
thread 'main' panicked at 'JSON PARSE ERROR: Error { kind: Json(ErrorImpl { code: Message("duplicate field `user`"), line: 1, column: 3128 }), url: None } 
""', src/main.rs:239:21

Problematic JSON:

{"id":"XQqOpGtnD6U","updated_at":"2018-03-23T12:24:56-04:00","username":"grakozy","name":"Greg Rakozy","first_name":"Greg","last_name":"Rakozy","twitter_username":"grakozy","portfolio_url":"http://grakozy.com","bio":"Like my photos? https://buymeacoff.ee/grakozy","location":"Salt Lake City, Utah","links":{"self":"https://api.unsplash.com/users/grakozy","html":"https://unsplash.com/@grakozy","photos":"https://api.unsplash.com/users/grakozy/photos","likes":"https://api.unsplash.com/users/grakozy/likes","portfolio":"https://api.unsplash.com/users/grakozy/portfolio","following":"https://api.unsplash.com/users/grakozy/following","followers":"https://api.unsplash.com/users/grakozy/followers"},"profile_image":{"small":"https://images.unsplash.com/profile-1495388545592-e4e376925c59?ixlib=rb-0.3.5&q=80&fm=jpg&crop=faces&cs=tinysrgb&fit=crop&h=32&w=32&s=4a6479456ed968ba331e01668f231990","medium":"https://images.unsplash.com/profile-1495388545592-e4e376925c59?ixlib=rb-0.3.5&q=80&fm=jpg&crop=faces&cs=tinysrgb&fit=crop&h=64&w=64&s=12ae79a24d842721d9a2e3969a24c1f8","large":"https://images.unsplash.com/profile-1495388545592-e4e376925c59?ixlib=rb-0.3.5&q=80&fm=jpg&crop=faces&cs=tinysrgb&fit=crop&h=128&w=128&s=913fbf5443cc4c00c436535f78b6d0aa","custom":"https://images.unsplash.com/profile-1495388545592-e4e376925c59?ixlib=rb-0.3.5&q=80&fm=jpg&crop=entropy&cs=tinysrgb&w=3840&fit=crop&s=2210724d2bfd4bc75d4851a26ff18cd9"},"total_collections":19,"instagram_username":"grakozy","total_likes":164,"total_photos":75},"current_user_collections":[],"slug":null,"location":{"title":"Hardware Ranch WMA, Hyrum, United States","name":"Hardware Ranch WMA","city":"Hyrum","country":"United States","position":{"latitude":41.6188037,"longitude":-111.5647165}},"exif":{"make":"Canon","model":"EOS 5D Mark II","exposure_time":"25","aperture":"2.8","focal_length":"14","iso":1600},"views":1949080,"downloads":14745}

rustc 1.24.0
FreeBSD 11.1-RELEASE-p6
GNOME 3.18.2

run clippy on code

currently clippy has some problems and is unable to run. This issue is just here to remind me to do it again.

Panic: invalid type: null, expected a string

$ cargo run
XDG_PICTURES_DIR is "/home/david/Pictures"
wrote faulty json to "jsons/wYL9CJnbcG"
thread 'main' panicked at 'JSON PARSE ERROR: Error { kind: Json(ErrorImpl { code: Message("invalid type: null, expected a string"), line: 1, column: 3450 }), url: None } 
 ""', src/main.rs:256:21
note: Run with `RUST_BACKTRACE=1` for a backtrace.

The json seems to be incomplete:

"country":"United States","position":{"latitude":33.702679446692,"longitude":-117.010282939209}},"exif":{"make":"Sony","model":"ILCE-7RM2","exposure_time":"1/4000","aperture":"5.0","focal_length":"55","iso":100},"views":1537820,"downloads":16720}

Anyway, I'm thinking some String field in a struct should actually be Option<String>, I just can't tell which.
I'm kinda new to Serializing/Deserializing, and I'm wondering how to determine the struct type info. Is there some rule, or is it documented at unsplash?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.