The awesome copy Subscribe

Well, I used to forget about copy()...

It just turned this ugly duckling

Profiles.updateUser(u, User(newusername, u.firstName, u.lastName, u.yob, u.email, u.pwd, u.status, u.roles, u.addr, u.prefs, u._id))

into

Profiles.updateUser(u, u.copy(username=newusername)

I know it could be even simpler, but that's probably the only occurrence of that statement...

Eh?

By: Razie | 2014-04-29 .. 2016-05-13 | Tags: post , scala , programming |


See more in: Cool Scala Subscribe

Viewed 406 times ( | Print ) this page.


This content is Copyrighted, all rights reserved.

You need to log in to post a comment!