Coder Social home page Coder Social logo

Comments (9)

masklinn avatar masklinn commented on May 23, 2024

How do you figure that'd work for examples using main e.g. second example of the readme?

from diesel.

defyrlt avatar defyrlt commented on May 23, 2024

I think that .unwrap() is a great thing for docs/examples. You don't have to teach your users how to handle error cases - there's a chapter in the Book for it.

from diesel.

sgrif avatar sgrif commented on May 23, 2024

The example using main is probably fine. I think many of our examples could change to use try!, or change their assertion to compare against Ok though

from diesel.

sgrif avatar sgrif commented on May 23, 2024

I don't think we need to teach users how to handle error cases, but if we can avoid unwrap without actually making the example less clear, I'd like to.

from diesel.

mfpiccolo avatar mfpiccolo commented on May 23, 2024

If this repo is going to be a popular place for people who newer to Rust (which I think it will be) it is important to show how to do it the right way. Or don't show it at all.

Perhaps saving the Result as a variable and then a comment underneath about dealing with the result?

from diesel.

hiimtaylorjones avatar hiimtaylorjones commented on May 23, 2024

Shouldn't this be closed because of the above PR? If not, I'm more than willing to finish what work wasn't covered by #45!

from diesel.

sgrif avatar sgrif commented on May 23, 2024

I think that there are still a few places left but I can't confirm at the moment. Feel free to let me know if that's the case

from diesel.

hiimtaylorjones avatar hiimtaylorjones commented on May 23, 2024

Ah, I see what you're talking about.

Upon doing a global project search for /// assert_eq!(, I've found that cases that use .unwrap() in the assert are all using Ok([statement]) now. Is this the desired beahvior?

Anyways, I'm recommending closing this issue and my Issue #34 PR if everything is as it should be. Sorry for the misunderstanding!

from diesel.

sgrif avatar sgrif commented on May 23, 2024

Thanks!

On Thu, May 12, 2016 at 7:31 AM Taylor Jones [email protected]
wrote:

Ah, I see what you're talking about.

Upon doing a global project search for /// assert_eq!(, I've found that
cases that use .unwrap() in the assert are all using Ok([statement]) now.
Is this the desired beahvior?

Anyways, I'm closing this PR and recommending that #34
#34 be closed if everything
is as it should be. Sorry for the misunderstanding!


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#34 (comment)

from diesel.

Related Issues (20)

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.