Skip to content
Open
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
13 changes: 13 additions & 0 deletions linkerd/http/body-eos/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,3 +130,16 @@ where
};
}
}

// === impl EosRef ===

/// A reference to the end of a stream can be cheaply cloned.
///
/// Each of the variants are empty tags, or immutable references.
impl<'a, E> Clone for EosRef<'a, E> {
fn clone(&self) -> Self {
*self
}
}
Comment on lines +136 to +143
Copy link
Member Author

Choose a reason for hiding this comment

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

https://gist.github.com/cratelyn/ff1e2d4299ae2626c229dc31aa21597b

#[derive(Clone)] will only work if E: Clone. this is manually implemented because we want this reference to be clonable even if E: Clone does not hold.


impl<'a, E> Copy for EosRef<'a, E> {}
Loading