The new Path API still has a "return a new path" set of APIs. They're just
named differently. For example, the old path.push("foo") is now
path.join("foo"). And all the path.set_*() mutating methods have variants
path.with_*() that return a new path.-Kevin On Oct 18, 2013, at 9:09 AM, Jack Moffitt <[email protected]> wrote: > In the latest Rust upgrade for Servo, I noticed that the path API is > now mutate-in-place instead of return a new path. It used to be that > path.push("foo") gave you a new path with an extra component, but now > path.push("foo") returns () and mutates the path in place. > > I liked the old API better. I realize this is probably more consistent > with std::vec, and consistency is good. I thought I'd bring this up to > see what other people thought as a lot of the APIs are getting > rewritten lately and I haven't seen any concrete guidelines on what > they should be. > > If we decide that both API styles are good to have, what should the > naming convention be for the functional vs. mutable ones? Ruby, > Scheme, and Clojure use `!` to denote the in-place mutation ones, but > that syntax is for macros in rust. > > jack. > _______________________________________________ > Rust-dev mailing list > [email protected] > https://mail.mozilla.org/listinfo/rust-dev
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________ Rust-dev mailing list [email protected] https://mail.mozilla.org/listinfo/rust-dev
