sharks gonna grow quickly and once his mouth is big enough he'll swallow the betta, if he doesn't nip him to death first- bettas tend to get picked on by tank mates that aren't totally passive. I don't know how nippy rainbow sharks are but I'd say they're more aggressive than a cory.
Rainbow sharks are hit/miss on the nippy factor. If the tank was larger, with plants, I'd say the betta would be pretty safe from him, as long as he didn't spend too much time near the bottom. If anything, grab a shortfin variety, like a king betta, or indo fighter/roundtail. Adult rainbow sharks can't swallow them, but in a small tank, there's just not enough space for the betta to stay out of his way.