I was thinking a bit about the proof of the fact that $\ell^{\infty}$ is not separable. And from the proof I saw, which uses a subspace which is discrete and uncountable, I thought I can prove it for any space which has the property.
Let's take $M$ a metric space with a discrete subspace $X$. Let $D$ be a dense subset of $M$. For every $x\in X$, we consider the ball $B_x=B_{\frac{1}{3}}(x)$. Then since $D$ is dense, for every such $x$, $B_x\cap D\neq \varnothing$, so let's take an arbitrary fixed element $a(x)\in B_x\cap D$ for each $x$.
Since $x\neq y\Rightarrow B_x\cap B_y=\varnothing$ (because $d(x,y)=1$), so $(B_x\cap D)\cap (B_y\cap D)=\varnothing\Rightarrow a(x)\neq a(y)$, so $x\mapsto a(x)$ is injective, thus $D$ is uncountable and $M$ is not separable.
Is that right?
Edit: Now I see that this can be solved using this since the subset $D$ would not be separable.
It's correct. The underlying topological argument is as follows. If you can find a collection of pairwise disjoint nonempty open sets in $X$, then any dense subset of $X$ must have cardinality at least as large as that of the collection.
While the argument used in your edit will work in metric spaces, it fails in general for topological spaces.