Skip to content

Commit

Permalink
Make darling_core::{codegen, options} crate-private
Browse files Browse the repository at this point in the history
This will make internal refactoring easier going forward.

This change also removes dead code exposed by making the crates private.

Fixes #58
  • Loading branch information
TedDriggs committed Mar 20, 2019
1 parent 419dd5d commit 038614f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 17 deletions.
9 changes: 3 additions & 6 deletions core/src/codegen/trait_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,13 @@ impl<'a> TraitImpl<'a> {
.collect()
}

/// Get the type parameters which are used by non-skipped fields.
/// Get the type parameters which are used by non-skipped, non-magic fields.
/// These type parameters will have a `FromMeta` bound applied to them in emitted
/// code.
pub fn used_type_params(&self) -> IdentSet {
self.type_params_matching(|f| !f.skip, |v| !v.skip)
}

/// Get the type parameters which are used by skipped fields.
pub fn skipped_type_params(&self) -> IdentSet {
self.type_params_matching(|f| f.skip, |v| v.skip)
}

fn type_params_matching<'b, F, V>(&'b self, field_filter: F, variant_filter: V) -> IdentSet
where
F: Fn(&&Field) -> bool,
Expand Down
4 changes: 2 additions & 2 deletions core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ mod macros_private;
mod macros_public;

pub mod ast;
pub mod codegen;
pub(crate) mod codegen;
pub mod derive;
pub mod error;
mod from_derive_input;
Expand All @@ -29,7 +29,7 @@ mod from_generics;
mod from_meta;
mod from_type_param;
mod from_variant;
pub mod options;
pub(crate) mod options;
pub mod usage;
pub mod util;

Expand Down
9 changes: 0 additions & 9 deletions core/src/options/shape.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,6 @@ pub struct Shape {
any: bool,
}

impl Shape {
pub fn all() -> Self {
Shape {
any: true,
..Default::default()
}
}
}

impl Default for Shape {
fn default() -> Self {
Shape {
Expand Down

0 comments on commit 038614f

Please sign in to comment.