-
Notifications
You must be signed in to change notification settings - Fork 291
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
[433] remove old run function #441
Conversation
80e4992
to
c62eba1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really appreciate this work, but would like to see some additional cleanup as noted in the requests.
src/about.md
Outdated
@@ -107,7 +107,7 @@ Since these recipes are intended to be reused as-is and encourage best | |||
practices, they set up error handling correctly when there are | |||
`Result` types involved. | |||
|
|||
The basic pattern we use is to have a `fn run() -> Result` that acts | |||
The basic pattern we use is to have a `fn main() -> Result` that acts |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
two lines after this, run
is referenced again.
src/about.md
Outdated
@@ -167,14 +166,14 @@ use url::{Url, Position}; | |||
# } | |||
# } | |||
|
|||
fn run() -> Result<()> { | |||
fn main() -> Result<()> { | |||
let parsed = Url::parse("https://httpbin.org/cookies/set?k2=v2&k1=v1")?; | |||
let cleaned: &str = &parsed[..Position::AfterPath]; | |||
println!("cleaned: {}", cleaned); | |||
Ok(()) | |||
} | |||
# |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These trailing # should be removed too.
89a4f96
to
e8d288d
Compare
I thought that i have finished but now i have problem with the two build |
I just tested Master against this, this is a bug introduced by Rust 1.30 I will create a new issue |
Ok thank @AndyGauge ! |
We will wait until the bug fix before merge this pr ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @sepiropht
Nice work some minor suggestions follow.
Please double check for any whitespace problems, trailing newlines or unneeded #
src/web/url/origin.md
Outdated
@@ -66,7 +64,7 @@ fn run() -> Result<()> { | |||
Ok(()) | |||
} | |||
# |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please remove the trailing #
and all uses of error_chain
when not completely necessary.
@@ -30,7 +30,7 @@ header! { (XRateLimitLimit, "X-RateLimit-Limit") => [usize] } | |||
header! { (XRateLimitRemaining, "X-RateLimit-Remaining") => [usize] } | |||
header! { (XRateLimitReset, "X-RateLimit-Reset") => [u64] } | |||
|
|||
fn run() -> Result<()> { | |||
fn main() -> Result<()> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This example requires slightly larger rewrite. It was never ideal with recursive run
but rename to main
has made it even more apparent. Some minimal main
should be extracted that calls possibly still recursive run
(I'd most likely appreciate rewriting it to iterative form).
src/encoding/csv/read.md
Outdated
@@ -85,7 +83,7 @@ fn run() -> Result<()> { | |||
Ok(()) | |||
} | |||
# |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please remove this and other occurrences of the trailing #
src/encoding/csv/read.md
Outdated
@@ -85,7 +83,7 @@ fn run() -> Result<()> { | |||
Ok(()) | |||
} | |||
# | |||
# quick_main!(run); | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no reason for trailing newline
src/encoding/complex/toml.md
Outdated
@@ -92,5 +91,5 @@ fn run() -> Result<()> { | |||
Ok(()) | |||
} | |||
# |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please remove this and other occurrences of the trailing #
src/encoding/complex/toml.md
Outdated
@@ -37,8 +37,7 @@ fn run() -> Result<()> { | |||
|
|||
Ok(()) | |||
} | |||
# | |||
# quick_main!(run); | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no reason for trailing newline
@@ -39,11 +39,10 @@ fn run() -> Result<()> { | |||
# #[cfg(not(target_os = "linux"))] | |||
# error_chain! {} | |||
# #[cfg(not(target_os = "linux"))] | |||
# fn run() -> Result<()> { | |||
# fn main() -> Result<()> { | |||
# Ok(()) | |||
# } | |||
# |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please remove the trailing #
src/about.md
Outdated
work. The `quick_main!` macro generates the actual `main` function and | ||
prints out the error if one occurred. | ||
work. Since rust 1.26, the main function can return a value, no need | ||
to use a custom `run` function like before. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This sentence
Since rust 1.26, the main function can return a value, no need to use a custom
run function like before.
should not be necessary
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the reviews, i will do this asap
I believe nightly rust works again, so I've triggered a build. I approved the commit that happened after my comments, and before Budziq. At this point, there are some more requested changes. Please let me know if you are following the requests, or if you would like fresh eyes on it. Great work so far! |
Ok cool ! I will do all the changes very soon. |
Apart conflicts this branch should be ok no ? |
I would love to see this land, I'll be working on your branch a little--hope you don't mind. |
fixes #433
Things to check before submitting a PR
cargo test
mdbook serve -o
./ci/spellchecker.sh
link-checker ./book
https://docs.rs/tar/*/tar/struct.Entry.html
Things to do after submitting PR
Thank you for reading, you may now delete this text! Thank you! 😄