Open CGMossa opened 4 years ago
Do I need to explicitly write
use std::convert::TryInto;
in order for
let resp: ComicResponse = http_client.get(&url).send()?.text()?.try_into()?;
to make sense? Otherwise I get that String
has no .try_into()
.
Minor typo:
todo!("do HTTP GET and save the file!");
should be without the ;
as otherwise it will not solve the return-type thing.
Also,
file.write_all(&*body.bytes()?).map_err(|e| e.into())
could (maybe??) be replaced with
file.write_all(&body.bytes()?).map_err(|e|e.into())
I simply don't get the &*
-trick. Is it to force a copy?
This is the last thing, I promise. Thanks again.
Adding my thanks for the blog post, most helpful and I enjoyed the 'code as you go style'
I hit the
num: Option
.. Issue mentioned above when I coded along for myself. Only other teensy bit of feedback I would as it that I spent I bit of time discovering what I had to use
so it would be great to mention all the use
s needed as you elaborate the code.
Thanks once again
Great post! It looked so enticing that I went through it very closely.
---
First, there is a difference between
Args
in blogpost and in the reference repo (this one)in blogpost
this difference makes:
invalid.
---
You have this:
but whilst following, it would be nice to have this instead:
as this will do the same from project root.
---
I am unsure how you have in the blogpost that one can use
Result<()>
onceuse anyhow::Result;
is stated? I don't think you intend to haveuse anyhow::Result as Result
, as you do use thestd::result::Result
elsewhere. So, I had to writeanyhow::Result
everywhere else.Thanks again!