'Don't want to return anything from my scala function , how to do it?

The scenario is like this I have a function abc() with return type of Future[Unit] now somehow inside this function I call another function xyz() which returns up a Future[List[String]] and eventually this function xyz() is only and last call inside my function abc() but as per the scala concept function returns whatever the last statement returns , so due to this I am getting a return mismatch error . What are the different ways to avoid it , I know about one way but that don't looks feasible to be as it increases 2-3 LOC.

abc():Future[Unit]={
   for{
        _ <- xyz()
     }
   yield()

}

In this way it was not giving an error at least, please also help me understand how for loops handles this futures correctly



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source