rust-by-practice icon indicating copy to clipboard operation
rust-by-practice copied to clipboard

Change Pair creation code on the Traits src and solution files.

Open DannyCeb opened this issue 2 years ago • 2 comments

Change the code to use the 'new' associated function instead create the Struct with the curly brackets syntax.

DannyCeb avatar Oct 09 '23 20:10 DannyCeb

Hi, I have a question, why should we use new instead of curly brackets syntax.

sunface avatar Oct 21 '23 00:10 sunface

Hello, thanks for your response In this case, just because the new function is already implemented for the structure on the sample code and it is not used In my opinion we can use new() instead bracket syntax or remove the new() function

DannyCeb avatar Oct 21 '23 01:10 DannyCeb