looks correct to me:

    def fromLessThan[T](cmp: (T, T) => Boolean): Ordering[T] = new Ordering[T] {
      def compare(x: T, y: T) = if (cmp(x, y)) -1 else if (cmp(y, x)) 1 else 0