From 475807042fbc0afe63684f6b6e65a1cc9403ac45 Mon Sep 17 00:00:00 2001 From: kangxiaoning Date: Sun, 21 Mar 2021 21:33:10 +0800 Subject: [PATCH] correct the signature of the `deref` method --- listings/ch15-smart-pointers/listing-15-10/src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/listings/ch15-smart-pointers/listing-15-10/src/main.rs b/listings/ch15-smart-pointers/listing-15-10/src/main.rs index a97f97c9b7..cce754d081 100644 --- a/listings/ch15-smart-pointers/listing-15-10/src/main.rs +++ b/listings/ch15-smart-pointers/listing-15-10/src/main.rs @@ -4,7 +4,7 @@ use std::ops::Deref; impl Deref for MyBox { type Target = T; - fn deref(&self) -> &T { + fn deref(&self) -> &Self::Target { &self.0 } }