Breastfeeding class said what?!

Took a breastfeeding class. In thr class they discussed alcohol and drug use and what was okay and not okay. They said if a mom is taking methadone they think that a baby breastfeeding from her is safer than drinking formula. I was completely shocked. They said they rather thr drug addicted moms on methadone breastfeed than use formula. I was shocked I had no idea and I would think that's more risky because what if they relapse and decide to use heroine and breastfeed? Methodone impairs you as well im not judging but I was genuinely shocked and felt I really learned something . Did you know this?