From dd6524a3e18f6a4a1539134931e7d1f845c16d5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Nevyho=C5=A1t=C4=9Bn=C3=BD?= Date: Fri, 5 May 2023 12:29:26 +0200 Subject: [PATCH] feat!: Remove Function and Optimizer from the prelude Having both Solver and Optimizer traits in the prelude, when a type implements both, the compiler can't distinguish between them for a call to `next` method. Given that function optimization is not the main goal of gomez, but just a by-product, as a temporary solution function-related traits are removed from the prelude. However, the design of the traits should be somehow improved so that the clash is not there at all. --- src/core/function.rs | 1 + src/lib.rs | 5 +---- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/core/function.rs b/src/core/function.rs index 03c11b0..8ad5b54 100644 --- a/src/core/function.rs +++ b/src/core/function.rs @@ -18,6 +18,7 @@ use super::{ /// two required methods: [`apply`](Function::apply) and [`dim`](Problem::dim). /// /// ```rust +/// use gomez::core::Function; /// use gomez::nalgebra as na; /// use gomez::prelude::*; /// use na::{Dim, DimName, IsContiguous}; diff --git a/src/lib.rs b/src/lib.rs index 6309c0f..a163515 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -261,10 +261,7 @@ pub use nalgebra; /// Gomez prelude. pub mod prelude { pub use crate::{ - core::{ - Domain, Function, Optimizer, Problem, ProblemError, Solver, System, Variable, - VariableBuilder, - }, + core::{Domain, Problem, ProblemError, Solver, System, Variable, VariableBuilder}, var, }; }