Skip to content

Commit ee80c47

Browse files
WaffleLapkinbaloo
authored andcommitted
Remove a ;, to allow Rust to infer the type (#1374)
`?` 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.
1 parent bb80aa0 commit ee80c47

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

der/src/writer/slice.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ impl<'a> SliceWriter<'a> {
3131
/// Encode a value which impls the [`Encode`] trait.
3232
pub fn encode<T: Encode>(&mut self, encodable: &T) -> Result<()> {
3333
if self.is_failed() {
34-
self.error(ErrorKind::Failed)?;
34+
self.error(ErrorKind::Failed)?
3535
}
3636

3737
encodable.encode(self).map_err(|e| {

0 commit comments

Comments
 (0)