Let $(X,d_X)$ and $(Y,d_Y)$ be two metric spaces and let $(D,d_X|D)$ be a metric subspace of $(X,d_X)$. Consider a function $f: D \to Y.$ If D is compact and f is continuous, then f is uniformly continuous.
I have to prove this, I know that this is the Heine-Cantor theorem. My question is: can I use the fact that in metric spaces the subset $D\subseteq X$ is compact and thus is closed and bounded or I do have to use the open cover and the finite subcover?