Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: use workspace.{package,dependencies} #17

Merged
merged 5 commits into from
Apr 26, 2023
Merged

Conversation

DaniPopes
Copy link
Member

@DaniPopes DaniPopes commented Apr 26, 2023

Fixes #13

Use valid package.categories in manifests: https://crates.io/category_slugs

Pass on std feature to dependencies everywhere

Removes "profile.dev" optimizations, results in way faster compilation:

  • --no-default-features and default features: 45s -> 35s
  • --all-features: 73s -> 50s

CC @prestwich

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's not do cfg(any(test, feature)), so tests run only when the feature is enabled, instead of always.

@@ -504,6 +504,7 @@ impl<const BITS: usize, const LIMBS: usize> serde::Serialize for Signed<BITS, LI
}
}

#[cfg(feature = "serde")]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was missing and failing individual compilation (with -p), tho I'm not sure why this cannot be caught when compiling the workspace.

@@ -514,20 +515,18 @@ impl<'de, const BITS: usize, const LIMBS: usize> serde::Deserialize<'de> for Sig
}
}

#[cfg(test)]
#[cfg(all(test, feature = "std"))]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use of String, ToString.

Comment on lines -49 to -50
#[auto_impl(&)]
#[cfg_attr(feature = "alloc", auto_impl(Box, Arc))]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Drop auto_impl for manual impl :^)

}
}

impl Encodable for [u8] {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All methods take &self so this has to be implemented without the ref.

Comment on lines +32 to +33
# TODO: Can we remove std from here?
eip712-serde = ["std", "dep:serde"]
Copy link
Member Author

@DaniPopes DaniPopes Apr 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

util::StringifiedNumeric uses String and ToString

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we could remove std by importing String and ToString from alloc 🤔

@@ -142,7 +145,7 @@ impl<'de> serde::Deserialize<'de> for B512 {
}
}

// code optained from: https://docs.rs/impl-serde/0.4.0/impl_serde/
// code stolen from: https://docs.rs/impl-serde/0.4.0/impl_serde/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😁

Copy link
Member

@prestwich prestwich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No changes needed. gonna go ahead and merge

@prestwich prestwich merged commit 8eae5ca into main Apr 26, 2023
@DaniPopes DaniPopes deleted the dani/workspace branch April 26, 2023 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Workspace Deps
2 participants