These are chat archives for rust-lang/rust

12th
Jul 2017
Alex Burka
@durka
Jul 12 2017 05:35
@lancecarlson when implementing a trait you can only implement the methods listed in the trait
Alexander Ronald Altman
@pthariensflame
Jul 12 2017 07:06
But since From only provides one method, you can just use a local function.
Lance Carlson
@lancecarlson
Jul 12 2017 15:20
@durka Thanks!
@pthariensflame hmm, local as in a function I impl directly on the struct or can I define more private methods with in the From?
ah or a function I guess I define outside the scope of any of those but still in the same "mod"
Daan Rijks
@ijks
Jul 12 2017 15:32
@lancecarlson You can do all of those things, but you can also nest function definitions within other functions: https://play.rust-lang.org/?gist=d520a45e8731ea6399c351fc460c7720&version=stable
Lance Carlson
@lancecarlson
Jul 12 2017 15:33
@ijks ahh! nice :)