@@ -17,12 +17,14 @@ use crate::workspace::add::GitOptions;
1717use crate :: workspace:: { DependencyOptions , InitOptions , ReinstallOptions } ;
1818
1919pub struct DefaultContext < I : Interface > {
20- interface : I ,
20+ _interface : I ,
2121}
2222
2323impl < I : Interface > DefaultContext < I > {
2424 pub fn new ( interface : I ) -> Self {
25- Self { interface }
25+ Self {
26+ _interface : interface,
27+ }
2628 }
2729
2830 /// Returns all matching package versions sorted by version
@@ -32,14 +34,7 @@ impl<I: Interface> DefaultContext<I> {
3234 channels : IndexSet < Channel > ,
3335 platform : Platform ,
3436 ) -> miette:: Result < Option < Vec < RepoDataRecord > > > {
35- crate :: workspace:: search:: search_exact (
36- & self . interface ,
37- None ,
38- match_spec,
39- channels,
40- platform,
41- )
42- . await
37+ crate :: workspace:: search:: search_exact ( None , match_spec, channels, platform) . await
4338 }
4439
4540 /// Returns all matching packages with their latest versions
@@ -49,8 +44,7 @@ impl<I: Interface> DefaultContext<I> {
4944 channels : IndexSet < Channel > ,
5045 platform : Platform ,
5146 ) -> miette:: Result < Option < Vec < RepoDataRecord > > > {
52- crate :: workspace:: search:: search_wildcard ( & self . interface , None , search, channels, platform)
53- . await
47+ crate :: workspace:: search:: search_wildcard ( None , search, channels, platform) . await
5448 }
5549}
5650
@@ -150,7 +144,6 @@ impl<I: Interface> WorkspaceContext<I> {
150144 git_options : GitOptions ,
151145 ) -> miette:: Result < Option < UpdateDeps > > {
152146 crate :: workspace:: add:: add_conda_dep (
153- & self . interface ,
154147 self . workspace_mut ( ) ?,
155148 specs,
156149 spec_type,
@@ -166,14 +159,8 @@ impl<I: Interface> WorkspaceContext<I> {
166159 editable : bool ,
167160 options : DependencyOptions ,
168161 ) -> miette:: Result < Option < UpdateDeps > > {
169- crate :: workspace:: add:: add_pypi_dep (
170- & self . interface ,
171- self . workspace_mut ( ) ?,
172- pypi_deps,
173- editable,
174- options,
175- )
176- . await
162+ crate :: workspace:: add:: add_pypi_dep ( self . workspace_mut ( ) ?, pypi_deps, editable, options)
163+ . await
177164 }
178165
179166 pub async fn remove_conda_deps (
@@ -183,7 +170,6 @@ impl<I: Interface> WorkspaceContext<I> {
183170 dep_options : DependencyOptions ,
184171 ) -> miette:: Result < ( ) > {
185172 crate :: workspace:: remove:: remove_conda_deps (
186- & self . interface ,
187173 self . workspace_mut ( ) ?,
188174 specs,
189175 spec_type,
@@ -197,13 +183,7 @@ impl<I: Interface> WorkspaceContext<I> {
197183 pypi_deps : PypiDeps ,
198184 options : DependencyOptions ,
199185 ) -> miette:: Result < ( ) > {
200- crate :: workspace:: remove:: remove_pypi_deps (
201- & self . interface ,
202- self . workspace_mut ( ) ?,
203- pypi_deps,
204- options,
205- )
206- . await
186+ crate :: workspace:: remove:: remove_pypi_deps ( self . workspace_mut ( ) ?, pypi_deps, options) . await
207187 }
208188
209189 pub async fn reinstall (
@@ -224,7 +204,7 @@ impl<I: Interface> WorkspaceContext<I> {
224204 & self ,
225205 environment : Option < EnvironmentName > ,
226206 ) -> miette:: Result < HashMap < EnvironmentName , HashMap < TaskName , Task > > > {
227- crate :: workspace:: task:: list_tasks ( & self . interface , & self . workspace , environment) . await
207+ crate :: workspace:: task:: list_tasks ( & self . workspace , environment) . await
228208 }
229209
230210 pub async fn add_task (
@@ -284,7 +264,6 @@ impl<I: Interface> WorkspaceContext<I> {
284264 platform : Platform ,
285265 ) -> miette:: Result < Option < Vec < RepoDataRecord > > > {
286266 crate :: workspace:: search:: search_exact (
287- & self . interface ,
288267 Some ( & self . workspace ) ,
289268 match_spec,
290269 channels,
@@ -300,13 +279,7 @@ impl<I: Interface> WorkspaceContext<I> {
300279 channels : IndexSet < Channel > ,
301280 platform : Platform ,
302281 ) -> miette:: Result < Option < Vec < RepoDataRecord > > > {
303- crate :: workspace:: search:: search_wildcard (
304- & self . interface ,
305- Some ( & self . workspace ) ,
306- search,
307- channels,
308- platform,
309- )
310- . await
282+ crate :: workspace:: search:: search_wildcard ( Some ( & self . workspace ) , search, channels, platform)
283+ . await
311284 }
312285}
0 commit comments