-
-
Notifications
You must be signed in to change notification settings - Fork 62
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
First example should be expanded to a complete program #193
Comments
Hi, thanks for trying out Isahc! The examples use the try ( The key error is this part of the error message:
If you want the program to simply panic and exit if an error occurs, you can replace |
@sagebind |
There are several complete examples of Rust programs in the examples directory that you can look to in order to test things out, which is linked to in the library documentation home page at https://docs.rs/isahc.
This is not a common practice in Rust library documentation, mainly because (1) it clutters up the example snippets with extra ceremony that can make things busier and take longer to read, and (2) It may be worth considering though for the very first example, but for a full program the best place maybe for absolute beginners to start would be the
Rust code typically can't usually be copied and pasted into arbitrary programs, since Rust has strong lifetime and type checking requirements that affect surrounding code. I apologize if you had a poor first experience, but I'm not sure what else I could do to help as a library maintainer. |
Thinking about this further, the code snippet in the README file for sure could stand to be updated and expanded. That's something that definitely makes sense. I'll do that shortly. |
@sagebind |
Also refresh a few of the existing example programs adding comments where necessary. Fixes #193
Example:
Error:
Rust version:
The text was updated successfully, but these errors were encountered: