I'm waiting for my pull request to be accepted, but it should be noted that since the new version of the function takes both &str and String, all of that strange syntax will still compile and will still be there until someone changes it.
On Thu, May 29, 2014 at 7:48 PM, Nicholas Platt <platt.nicho...@gmail.com> wrote: > I encountered inconsistencies like this quite a bit while coding up my > first program in Rust[0]. Glad to see this addressed; the current API > forces some really awkward syntax, I think. > > As shown in that file, the time crate also requires strange syntax, in > my opinion. Ideally arguments are always "plain-old-strings", ie: > > this_should("always", "work"); > this_should_not(&"be".to_string(), ["required".to_string()]); > > But there may be more to the story than I'm aware of. > > -- Nick > > [0]: https://github.com/uutils/coreutils/blob/master/touch/touch.rs#L111 > > On Mon, May 26, 2014 at 9:38 PM, Kevin Ballard <ke...@sb.org> wrote: > > Sure, that seems like a pretty easy job to tackle. You should audit the > > whole getopts API to see where it uses String inappropriately. Any > &[String] > > parameters should probably be &[S] where <S: Str>, and any bare String > > parameters (if any) should probably be &str. > > > > -Kevin > > > > On May 26, 2014, at 6:29 PM, Gulshan Singh <gsingh2...@gmail.com> wrote: > > > > On Mon, May 26, 2014 at 2:56 PM, Kevin Ballard <ke...@sb.org> wrote: > >> > >> All the methods that take &[String] should probably be rewritten to be > >> generic with <S: Str> and take &[S] instead, which will allow taking > either > >> a slice of Strings or a slice of &str's. > > > > > > I've been wanting to contribute to Rust for a while. This seems like the > > right thing to do and I don't think it's a hard change. Should I go ahead > > and make it? > > > > -- > > Gulshan Singh > > University of Michigan, Class of 2015 > > College of Engineering, Computer Science Major > > guls...@umich.edu | 248.961.6317 > > Alternate E-mail: gsingh2...@gmail.com > > > > > > > > _______________________________________________ > > Rust-dev mailing list > > Rust-dev@mozilla.org > > https://mail.mozilla.org/listinfo/rust-dev > > >
_______________________________________________ Rust-dev mailing list Rust-dev@mozilla.org https://mail.mozilla.org/listinfo/rust-dev