How to type a bar over/under a letter in mhchem of LaTeX?

I use usepackage mhchem to write chemical equations in LaTeX, it works fine most of time. Today I encountered a problem, how to type a horizontal bar over (or under) a letter?

After some Googling work, here is my solution, combining the command mathrm and overline/underline. The command \underline ......