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

feat: Simplify GitOid trait bounds #96

Merged
merged 1 commit into from
Feb 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 19 additions & 19 deletions gitoid/src/gitoid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ pub struct GitOid<H, O>
where
H: HashAlgorithm,
O: ObjectType,
<H as OutputSizeUser>::OutputSize: ArrayLength<u8>,
H::OutputSize: ArrayLength<u8>,
GenericArray<u8, H::OutputSize>: Copy,
{
#[doc(hidden)]
Expand All @@ -55,7 +55,7 @@ impl<H, O> GitOid<H, O>
where
H: HashAlgorithm,
O: ObjectType,
<H as OutputSizeUser>::OutputSize: ArrayLength<u8>,
H::OutputSize: ArrayLength<u8>,
GenericArray<u8, H::OutputSize>: Copy,
{
//===========================================================================================
Expand All @@ -78,7 +78,7 @@ where
where
H: HashAlgorithm,
O: ObjectType,
<H as OutputSizeUser>::OutputSize: ArrayLength<u8>,
H::OutputSize: ArrayLength<u8>,
GenericArray<u8, H::OutputSize>: Copy,
{
// PANIC SAFETY: We're reading from an in-memory buffer, so no IO errors can arise.
Expand All @@ -95,7 +95,7 @@ where
where
H: HashAlgorithm,
O: ObjectType,
<H as OutputSizeUser>::OutputSize: ArrayLength<u8>,
H::OutputSize: ArrayLength<u8>,
GenericArray<u8, H::OutputSize>: Copy,
{
GitOid::from_bytes(s.as_bytes())
Expand Down Expand Up @@ -170,7 +170,7 @@ impl<H, O> FromStr for GitOid<H, O>
where
H: HashAlgorithm,
O: ObjectType,
<H as OutputSizeUser>::OutputSize: ArrayLength<u8>,
H::OutputSize: ArrayLength<u8>,
GenericArray<u8, H::OutputSize>: Copy,
{
type Err = Error;
Expand All @@ -184,7 +184,7 @@ impl<H, O> Clone for GitOid<H, O>
where
H: HashAlgorithm,
O: ObjectType,
<H as OutputSizeUser>::OutputSize: ArrayLength<u8>,
H::OutputSize: ArrayLength<u8>,
GenericArray<u8, H::OutputSize>: Copy,
{
fn clone(&self) -> Self {
Expand All @@ -196,7 +196,7 @@ impl<H, O> Copy for GitOid<H, O>
where
H: HashAlgorithm,
O: ObjectType,
<H as OutputSizeUser>::OutputSize: ArrayLength<u8>,
H::OutputSize: ArrayLength<u8>,
GenericArray<u8, H::OutputSize>: Copy,
{
}
Expand All @@ -205,7 +205,7 @@ impl<H, O> PartialEq<GitOid<H, O>> for GitOid<H, O>
where
H: HashAlgorithm,
O: ObjectType,
<H as OutputSizeUser>::OutputSize: ArrayLength<u8>,
H::OutputSize: ArrayLength<u8>,
GenericArray<u8, H::OutputSize>: Copy,
{
fn eq(&self, other: &GitOid<H, O>) -> bool {
Expand All @@ -217,7 +217,7 @@ impl<H, O> Eq for GitOid<H, O>
where
H: HashAlgorithm,
O: ObjectType,
<H as OutputSizeUser>::OutputSize: ArrayLength<u8>,
H::OutputSize: ArrayLength<u8>,
GenericArray<u8, H::OutputSize>: Copy,
{
}
Expand All @@ -226,7 +226,7 @@ impl<H, O> PartialOrd<GitOid<H, O>> for GitOid<H, O>
where
H: HashAlgorithm,
O: ObjectType,
<H as OutputSizeUser>::OutputSize: ArrayLength<u8>,
H::OutputSize: ArrayLength<u8>,
GenericArray<u8, H::OutputSize>: Copy,
{
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
Expand All @@ -238,7 +238,7 @@ impl<H, O> Ord for GitOid<H, O>
where
H: HashAlgorithm,
O: ObjectType,
<H as OutputSizeUser>::OutputSize: ArrayLength<u8>,
H::OutputSize: ArrayLength<u8>,
GenericArray<u8, H::OutputSize>: Copy,
{
fn cmp(&self, other: &Self) -> Ordering {
Expand All @@ -250,7 +250,7 @@ impl<H, O> Hash for GitOid<H, O>
where
H: HashAlgorithm,
O: ObjectType,
<H as OutputSizeUser>::OutputSize: ArrayLength<u8>,
H::OutputSize: ArrayLength<u8>,
GenericArray<u8, H::OutputSize>: Copy,
{
fn hash<H2>(&self, state: &mut H2)
Expand All @@ -265,7 +265,7 @@ impl<H, O> Debug for GitOid<H, O>
where
H: HashAlgorithm,
O: ObjectType,
<H as OutputSizeUser>::OutputSize: ArrayLength<u8>,
H::OutputSize: ArrayLength<u8>,
GenericArray<u8, H::OutputSize>: Copy,
{
fn fmt(&self, f: &mut Formatter<'_>) -> FmtResult {
Expand All @@ -279,7 +279,7 @@ impl<H, O> Display for GitOid<H, O>
where
H: HashAlgorithm,
O: ObjectType,
<H as OutputSizeUser>::OutputSize: ArrayLength<u8>,
H::OutputSize: ArrayLength<u8>,
GenericArray<u8, H::OutputSize>: Copy,
{
fn fmt(&self, f: &mut Formatter<'_>) -> FmtResult {
Expand All @@ -291,7 +291,7 @@ struct GitOidUrlParser<'u, H, O>
where
H: HashAlgorithm,
O: ObjectType,
<H as OutputSizeUser>::OutputSize: ArrayLength<u8>,
H::OutputSize: ArrayLength<u8>,
GenericArray<u8, H::OutputSize>: Copy,
{
url: &'u Url,
Expand All @@ -313,7 +313,7 @@ impl<'u, H, O> GitOidUrlParser<'u, H, O>
where
H: HashAlgorithm,
O: ObjectType,
<H as OutputSizeUser>::OutputSize: ArrayLength<u8>,
H::OutputSize: ArrayLength<u8>,
GenericArray<u8, H::OutputSize>: Copy,
{
fn new(url: &'u Url) -> GitOidUrlParser<'u, H, O> {
Expand Down Expand Up @@ -402,7 +402,7 @@ impl<H, O> TryFrom<Url> for GitOid<H, O>
where
H: HashAlgorithm,
O: ObjectType,
<H as OutputSizeUser>::OutputSize: ArrayLength<u8>,
H::OutputSize: ArrayLength<u8>,
GenericArray<u8, H::OutputSize>: Copy,
{
type Error = Error;
Expand Down Expand Up @@ -430,7 +430,7 @@ fn gitoid_from_buffer<H, O, R>(
where
H: HashAlgorithm,
O: ObjectType,
<H as OutputSizeUser>::OutputSize: ArrayLength<u8>,
H::OutputSize: ArrayLength<u8>,
GenericArray<u8, H::OutputSize>: Copy,
R: Read,
{
Expand Down Expand Up @@ -506,7 +506,7 @@ fn hash_from_buffer<H, O, R>(
where
H: HashAlgorithm,
O: ObjectType,
<H as OutputSizeUser>::OutputSize: ArrayLength<u8>,
H::OutputSize: ArrayLength<u8>,
GenericArray<u8, H::OutputSize>: Copy,
R: Read,
{
Expand Down
Loading