I have read that if I have two vectors $ |0\rangle $ and $ |1\rangle $, then$$ \mathrm{tr} ( |0\rangle \langle1|)=\langle1|0\rangle. $$
I also know that for an operator $A$ $$ \mathrm{tr} ( A) = \sum_{i} \langle i|A|i\rangle $$ where $ |i\rangle $ is an arbitrary basis. Well, if I was to choose my operator $A =|0\rangle \langle1|$ and use the $ |0\rangle $, $ |1\rangle $ basis to evaluate the trace, I will get
$$ \mathrm{tr} (|0\rangle \langle1|) = \langle 0|0\rangle \langle1|0\rangle + \langle1|0\rangle \langle1|1\rangle $$
and assuming the basis vectors are normalised I get
$$ \mathrm{tr} (|0\rangle \langle1|) = 2\langle1|0\rangle $$ which is disagreement with what I have read. Where am I going wrong?