The awesome copy Subscribe Pub

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.pwd, u.status, u.roles, u.addr, u.prefs, u._id))


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

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


Was this useful?    

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

See more in: Cool Scala Subscribe

Viewed 998 times ( | Print ) this page.

You need to log in to post a comment!