Giter VIP home page Giter VIP logo

Comments (7)

schickling avatar schickling commented on July 18, 2024

I'm just curious: Why are you rewriting every to_string() with the format! macro? Is this considered to be a best practice?

from lettre.

ArtemGr avatar ArtemGr commented on July 18, 2024

The reason I did it was because to_string() no longer wanted to compile. Maybe it was some kind of glitch and it works again, or maybe it was just removed from Prelude and should have been imported explicitly.

And yes, AFAIK, format! is the way to go.
to_string() is implemented as (a variation of) format! - http://doc.rust-lang.org/src/collections/string.rs.html#937-946

from lettre.

schickling avatar schickling commented on July 18, 2024

Thanks for that information @ArtemGr

from lettre.

ArtemGr avatar ArtemGr commented on July 18, 2024

NB, for strings format! is temporarily slower than String::from_str, rust-lang/rust#20400

from lettre.

ArtemGr avatar ArtemGr commented on July 18, 2024

FYI, an updated patch landed at https://github.com/ArtemGr/rust-smtp/commit/aaf2147117da119fba87986e10ea012d9fe6c74c

from lettre.

amousset avatar amousset commented on July 18, 2024

Merged, thank you. I am updating the tests.

from lettre.

ArtemGr avatar ArtemGr commented on July 18, 2024

Cool! )

BTW, I'm not sure if the features vector will be formatted correctly, had to use the {:?} as a quick fix because it wouldn't format with {} for some reason.

from lettre.

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.