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.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?


Was this useful?    

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


See more in: Cool Scala Subscribe

Viewed 1147 times ( | History | Print ) this page.

You need to log in to post a comment!