Skip to content

Commit 41988a3

Browse files
remove unused dyn traits
1 parent 93dd909 commit 41988a3

1 file changed

Lines changed: 0 additions & 75 deletions

File tree

cli/src/args.rs

Lines changed: 0 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -209,40 +209,6 @@ pub mod resource {
209209
}
210210
}
211211

212-
pub struct DynResourceWrapper<R> {
213-
resource: R,
214-
}
215-
216-
pub trait ArgvDynResource {
217-
fn parse_argv_dyn(
218-
&self,
219-
argv: &mut VecDeque<OsString>,
220-
) -> Result<Box<dyn ResourceValue + '_>, Box<dyn error::Error + '_>>;
221-
}
222-
223-
impl<R> ArgvDynResource for DynResourceWrapper<R>
224-
where
225-
R: ArgvResource,
226-
<R as ArgvResource>::ArgvParseError: error::Error,
227-
{
228-
fn parse_argv_dyn(
229-
&self,
230-
argv: &mut VecDeque<OsString>,
231-
) -> Result<Box<dyn ResourceValue + '_>, Box<dyn error::Error + '_>> {
232-
let Self { resource } = self;
233-
resource
234-
.parse_argv(argv)
235-
.map(|val| {
236-
let val: Box<dyn ResourceValue> = Box::new(val);
237-
val
238-
})
239-
.map_err(|e| {
240-
let e: Box<dyn error::Error> = Box::new(e);
241-
e
242-
})
243-
}
244-
}
245-
246212
pub trait PositionalArgvResource: ArgvResource {}
247213

248214
pub trait SchemaResource: Resource {
@@ -271,47 +237,6 @@ pub mod resource {
271237
Ok(self.parse_schema(v).map_err(WrapperError::Out)?)
272238
}
273239
}
274-
275-
pub trait SchemaDynResource {
276-
type B: Backend;
277-
fn parse_schema_dyn_str<'a>(
278-
&'a self,
279-
s: <Self::B as Backend>::Str<'a>,
280-
) -> Result<Box<dyn ResourceValue + '_>, Box<dyn error::Error + '_>>;
281-
}
282-
283-
impl<R> SchemaDynResource for DynResourceWrapper<R>
284-
where
285-
R: SchemaResource,
286-
<R as SchemaResource>::SchemaParseError: error::Error,
287-
for<'a> <<R as SchemaResource>::B as Backend>::Err<'a>: error::Error,
288-
{
289-
type B = <R as SchemaResource>::B;
290-
fn parse_schema_dyn_str<'a>(
291-
&'a self,
292-
s: <Self::B as Backend>::Str<'a>,
293-
) -> Result<Box<dyn ResourceValue + '_>, Box<dyn error::Error + '_>> {
294-
let Self { resource } = self;
295-
resource
296-
.parse_schema_str(s)
297-
.map(|val| {
298-
let val: Box<dyn ResourceValue> = Box::new(val);
299-
val
300-
})
301-
.map_err(|e| {
302-
let e: Box<dyn error::Error> = Box::new(e);
303-
e
304-
})
305-
}
306-
}
307-
308-
pub struct CliCommandSpec {
309-
resources: Vec<Box<dyn ArgvDynResource>>,
310-
}
311-
312-
pub struct SchemaCommandSpec<B> {
313-
resources: Vec<Box<dyn SchemaDynResource<B = B>>>,
314-
}
315240
}
316241

317242
pub trait CommandFormat: fmt::Debug {

0 commit comments

Comments
 (0)