Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Error-chain from examples not requiring it #506

Closed
AndyGauge opened this issue Dec 14, 2018 · 1 comment · Fixed by #525 or #531
Closed

Remove Error-chain from examples not requiring it #506

AndyGauge opened this issue Dec 14, 2018 · 1 comment · Fixed by #525 or #531

Comments

@AndyGauge
Copy link
Collaborator

Per #502 these are identified as needing error-chain removed:

[ ] https://rust-lang-nursery.github.io/rust-cookbook/concurrency/threads.html#calculate-sha1-sum-of-iso-files-concurrently
[ ] https://rust-lang-nursery.github.io/rust-cookbook/cryptography/hashing.html#sign-and-verify-a-message-with-hmac-digest
[ ] https://rust-lang-nursery.github.io/rust-cookbook/cryptography/encryption.html#salt-and-hash-a-password-with-pbkdf2
[ ] https://rust-lang-nursery.github.io/rust-cookbook/datetime/parse.html#parse-string-into-datetime-struct
[ ] https://rust-lang-nursery.github.io/rust-cookbook/development_tools/debugging/log.html#log-messages-with-a-custom-logger
[ ] https://rust-lang-nursery.github.io/rust-cookbook/development_tools/debugging/log.html#log-to-the-unix-syslog
[ ] https://rust-lang-nursery.github.io/rust-cookbook/development_tools/versioning.html#parse-and-increment-a-version-string
[ ] https://rust-lang-nursery.github.io/rust-cookbook/development_tools/versioning.html#parse-a-complex-version-string
[ ] https://rust-lang-nursery.github.io/rust-cookbook/development_tools/versioning.html#check-if-given-version-is-pre-release
[ ] https://rust-lang-nursery.github.io/rust-cookbook/encoding/strings.html#percent-encode-a-string
[ ] https://rust-lang-nursery.github.io/rust-cookbook/encoding/strings.html#encode-and-decode-hex
[ ] https://rust-lang-nursery.github.io/rust-cookbook/encoding/csv.html#read-csv-records
[ ] https://rust-lang-nursery.github.io/rust-cookbook/encoding/csv.html#read-csv-records-with-different-delimiter
[ ] https://rust-lang-nursery.github.io/rust-cookbook/encoding/csv.html#handle-invalid-csv-data-with-serde
[ ] https://rust-lang-nursery.github.io/rust-cookbook/encoding/complex.html#serialize-and-deserialize-unstructured-json
[ ] https://rust-lang-nursery.github.io/rust-cookbook/encoding/complex.html#deserialize-a-toml-configuration-file
[ ] https://rust-lang-nursery.github.io/rust-cookbook/encoding/complex.html#read-and-write-integers-in-little-endian-byte-order
[ ] https://rust-lang-nursery.github.io/rust-cookbook/file/read-write.html#read-lines-of-strings-from-a-file
[ ] https://rust-lang-nursery.github.io/rust-cookbook/file/read-write.html#avoid-writing-and-reading-from-a-same-file
[ ] https://rust-lang-nursery.github.io/rust-cookbook/file/read-write.html#access-a-file-randomly-using-a-memory-map
[ ] https://rust-lang-nursery.github.io/rust-cookbook/net/server.html#listen-on-unused-port-tcpip
[ ] https://rust-lang-nursery.github.io/rust-cookbook/os/external.html#redirect-both-stdout-and-stderr-of-child-process-to-the-same-file
[ ] https://rust-lang-nursery.github.io/rust-cookbook/os/external.html#continuously-process-child-process-outputs
[ ] https://rust-lang-nursery.github.io/rust-cookbook/web/url.html#parse-a-url-from-a-string-to-a-url-type
[ ] https://rust-lang-nursery.github.io/rust-cookbook/web/url.html#create-new-urls-from-a-base-url
[ ] https://rust-lang-nursery.github.io/rust-cookbook/web/url.html#extract-the-url-origin-scheme--host--port
[ ] https://rust-lang-nursery.github.io/rust-cookbook/web/url.html#remove-fragment-identifiers-and-query-pairs-from-a-url
[ ] https://rust-lang-nursery.github.io/rust-cookbook/web/clients/apis.html#query-the-github-api
[ ] https://rust-lang-nursery.github.io/rust-cookbook/web/clients/apis.html#check-if-an-api-resource-exists
[ ] https://rust-lang-nursery.github.io/rust-cookbook/web/clients/apis.html#consume-a-paginated-restful-api

Essentially these recipes do not require error-chain because they do not require error variants. There is only one error type and no other error-chain identified feature used in these examples, and as such are easier to reason without hidden gotchas like an error handling library. Some of these needs the quick_main macro replaced with a well defined main function, that can be hidden.

@henrifrancois
Copy link

The current recipes for APIs under Clients up on the website are faulty as they omit the error_chain crate in the examples given. The extern crate was removed, but the behavior it induced was not, with Result<()> being prominent in these examples. The error_chain should either be added again, or removed properly this time

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants