Import sibling module

Hi guys, I'm trying to import a sibling module while keeping the namespace and failing hard. My directory structure is:


I'm trying to grab the functions from so I can do something like math::lerp() instead of importing all the functions into the namespace (like lerp()).

I already added mod math in I've tried using use super::math, use math; and use crate::math, etc. but I always get some error about type ascription or using an undefined module. I'm on Rust 1.35.

I think I've been at this for about an hour now, can it be done?

If you are trying to call it inside you don't need to do anything besides declaring mod

If it's inside make sure you declared both modules inside and you can use super::math or use crate::math in


Sorry, I forgot to mention it was inside terrain. I did a hard reset in git and used use super::math and now it works. Maybe I was doing something else wrong :thinking: Thanks for the help!

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.