So I will try:
$$M(t)=\int^1_0 e^{tx}dx=\frac{1}{t}\left. \left(e^{tx} \right)\right|^1_0=\frac{e^t}{t}-\frac{1}{t}$$
And for general case where the interval is given as $[a,b]$
It looks obviously wrong, I think it's something to do with the partial integration, maybe I could take the $\frac{1}{b-a}$ out of the integral sign, but then a $x$ would be missing. But if I do so then:
$$M(t)=\frac{1}{b-a} \int^b_ae^{tx}dx=\frac{1}{t(b-a)}\left. \left(e^{tx} \right)\right|^b_a=\frac{e^{tb}-e^{ta}}{t(b-a)}$$
Also looks wrong, but I don't see, where is my mistake.
If $Y\sim\mathrm{Unif}(a,b)$ then $Y\stackrel{\mathrm d}= a+(b-a)X$, so \begin{align} \mathbb E[e^{tY}] &= \mathbb E[e^{t(a+(b-a)X)}]\\ &= \mathbb E[e^{at}e^{t(b-a)X}]\\ &= e^{at} \mathbb E[e^{t(b-a)X}]\\ &= e^{at} M(t(b-a))\\ &= e^{at} \frac{e^{t(b-a)}-1}{t(b-a)}\\ &= \frac{e^{bt}-e^{at}}{t(b-a)}, \end{align} which is the moment-generating function of a $\operatorname{Unif}(a,b)$ random variable.