Skip to content

Commit

Permalink
Remove a ;, to allow Rust to infer the type
Browse files Browse the repository at this point in the history
`?` currently influences inference s.t. for `error()?` rustc infers `T = ()`.
However, it is quite confusing -- `?` is not supposed to influence inference,
it's just a conicidence because of the curent implementation. There is an idea
to change this behavior in future Rust versions, such that this code won't
compile without this change.
  • Loading branch information
WaffleLapkin committed Apr 1, 2024
1 parent 0898cfe commit 1d8037d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion der/src/writer/slice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ impl<'a> SliceWriter<'a> {
/// Encode a value which impls the [`Encode`] trait.
pub fn encode<T: Encode>(&mut self, encodable: &T) -> Result<()> {
if self.is_failed() {
self.error(ErrorKind::Failed)?;
self.error(ErrorKind::Failed)?
}

encodable.encode(self).map_err(|e| {
Expand Down

0 comments on commit 1d8037d

Please sign in to comment.