Full working example:
How do you access "Example" from inside the "tests" module?
src/main.rs:
struct Example {}
#[cfg(test)]
mod tests {
#[test]
fn example() {
// Example is out of scope
}
}
Full working example:
How do you access "Example" from inside the "tests" module?
src/main.rs:
struct Example {}
#[cfg(test)]
mod tests {
#[test]
fn example() {
// Example is out of scope
}
}
You can access parent module's namespace with super:
struct Example {}
#[cfg(test)]
mod tests {
use super::Example;
#[test]
fn example() {
// Example is out of scope
}
}