.setFailureType(to: Error.self)

How can I convert a Just<T> to an AnyPublisher<T, Error>?

Just(x)
    .setFailureType(Error.self)
    .eraseToAnyPublisher()