-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ch. 10: Make social media discussion generic.
Twitter is now X, who knows what 'tweets' are called, and whether *any* of the current crop of social media platforms will exist by the time the 2027 or 2030 editions of Rust roll around, who knows?
- Loading branch information
1 parent
0896670
commit ef5b092
Showing
11 changed files
with
70 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions
8
...gs/ch10-generic-types-traits-and-lifetimes/no-listing-01-calling-trait-method/src/main.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
use aggregator::{Summary, Tweet}; | ||
use aggregator::{SocialPost, Summary}; | ||
|
||
fn main() { | ||
let tweet = Tweet { | ||
let post = SocialPost { | ||
username: String::from("horse_ebooks"), | ||
content: String::from( | ||
"of course, as you probably already know, people", | ||
), | ||
reply: false, | ||
retweet: false, | ||
repost: false, | ||
}; | ||
|
||
println!("1 new tweet: {}", tweet.summarize()); | ||
println!("1 new social post: {}", post.summarize()); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions
8
...ric-types-traits-and-lifetimes/no-listing-03-default-impl-calls-other-methods/src/main.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
use aggregator::{self, Summary, Tweet}; | ||
use aggregator::{self, SocialPost, Summary}; | ||
|
||
fn main() { | ||
// ANCHOR: here | ||
let tweet = Tweet { | ||
let post = SocialPost { | ||
username: String::from("horse_ebooks"), | ||
content: String::from( | ||
"of course, as you probably already know, people", | ||
), | ||
reply: false, | ||
retweet: false, | ||
repost: false, | ||
}; | ||
|
||
println!("1 new tweet: {}", tweet.summarize()); | ||
println!("1 new social post: {}", post.summarize()); | ||
// ANCHOR_END: here | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters