Skip to content

Commit 4640b3c

Browse files
committed
Remove unnecessary nested module
1 parent fd21fd4 commit 4640b3c

7 files changed

+18
-22
lines changed

src/highs_example_rust/constraint.rs renamed to src/constraint.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//! Provides functionality for optimisation constraints.
2-
use super::variable_definition::VariableDefinition;
2+
use crate::variable_definition::VariableDefinition;
33
use polars::prelude::*;
44
use std::path::Path;
55

src/main.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
//! Provides the main entry point to the highs_example_rust program.
22
3-
mod highs_example_rust;
3+
mod constraint;
4+
mod optimisation;
5+
mod settings;
6+
mod solver;
7+
mod variable_definition;
8+
9+
#[cfg(test)]
10+
mod test_common;
411

512
use std::env;
613
use std::path::Path;
@@ -12,5 +19,5 @@ fn main() {
1219
panic!("Must provide path to model configuration TOML file.");
1320
}
1421

15-
highs_example_rust::run(Path::new(&args[1]))
22+
optimisation::run(Path::new(&args[1]))
1623
}

src/highs_example_rust.rs renamed to src/optimisation.rs

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,6 @@
11
//! The main crate for highs_example_rust. This contains all of MUSE's functionality.
2-
pub mod constraint;
3-
mod settings;
4-
mod solver;
5-
pub mod variable_definition;
6-
7-
#[cfg(test)]
8-
pub mod test_common;
9-
10-
use settings::read_settings;
11-
use solver::{solve_highs, Sense};
2+
use crate::settings::read_settings;
3+
use crate::solver::{solve_highs, Sense};
124
use std::path::Path;
135

146
/// Run an optimisation.

src/highs_example_rust/settings.rs renamed to src/settings.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! Data structures representing settings files and a function for reading them.
2-
use super::constraint::Constraint;
3-
use super::variable_definition::VariableDefinition;
2+
use crate::constraint::Constraint;
3+
use crate::variable_definition::VariableDefinition;
44
use std::path::Path;
55

66
use serde::Deserialize;

src/highs_example_rust/solver.rs renamed to src/solver.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! Provides data structures and functions for performing optimisation.
2-
use super::constraint::Constraint;
3-
use super::variable_definition::VariableDefinition;
2+
use crate::constraint::Constraint;
3+
use crate::variable_definition::VariableDefinition;
44
pub use highs::Sense;
55
use highs::{HighsModelStatus, RowProblem};
66

src/highs_example_rust/test_common.rs renamed to src/test_common.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! Common functionality used by tests.
2-
use super::constraint::Constraint;
3-
use super::variable_definition::VariableDefinition;
2+
use crate::constraint::Constraint;
3+
use crate::variable_definition::VariableDefinition;
44
use std::f64::INFINITY;
55
use std::path::{Path, PathBuf};
66

@@ -11,8 +11,6 @@ pub fn get_example_path() -> PathBuf {
1111
.unwrap()
1212
.parent()
1313
.unwrap()
14-
.parent()
15-
.unwrap()
1614
.join("example")
1715
}
1816

src/highs_example_rust/variable_definition.rs renamed to src/variable_definition.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
//! Provides variable definition data structures for optimisation.
2-
use csv;
32
use serde::Deserialize;
43
use std::path::Path;
54

0 commit comments

Comments
 (0)