Skip to content

Commit

Permalink
Replace T: 'a + Messenger with T: Messenger
Browse files Browse the repository at this point in the history
reasons:

1. This annotation is no longer needed since it can be inferred from the fields present in the definitions in Rust 2018.
2. `T: 'a` annotation is never mentioned in previous chapters, this would make beinners confused.

references:

rust-lang/rfcs#2093
rust-lang/rust#44493
https://rust-lang-nursery.github.io/edition-guide/rust-2018/ownership-and-lifetimes/inference-in-structs.html
  • Loading branch information
tonytonyjan committed Feb 24, 2019
1 parent 6d3e77c commit 5245c58
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ch15-05-interior-mutability.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ pub trait Messenger {
fn send(&self, msg: &str);
}

pub struct LimitTracker<'a, T: 'a + Messenger> {
pub struct LimitTracker<'a, T: Messenger> {
messenger: &'a T,
value: usize,
max: usize,
Expand Down

0 comments on commit 5245c58

Please sign in to comment.