It`s not the best choice,but shouldn`t do any serious harm really.
Use electrical contact cleaner in a spray can in the future,because it dries without leaving any residue behind.
Carb cleaners usually contain a lubricant that stays in place after it dries,which is not what you want in this application.