Skip to content

Commit 7804bb4

Browse files
killercupsgrif
authored andcommitted
Advanced blog: Fix formatting, add help text
1 parent b58d5bb commit 7804bb4

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

examples/postgres/advanced-blog-cli/src/cli.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ pub enum Cli {
1616
EditPost {
1717
/// The id of the post to edit
1818
post_id: i32,
19+
/// Announce this piece of literary perfectionims to the world?
1920
#[structopt(short = "i", default_value = "false")]
2021
publish: bool,
2122
},

examples/postgres/advanced-blog-cli/src/main.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
extern crate bcrypt;
44
extern crate chrono;
5-
extern crate structopt;
6-
#[macro_use]
7-
extern crate structopt_derive;
85
#[macro_use]
96
extern crate diesel;
107
extern crate dotenv;
8+
extern crate structopt;
9+
#[macro_use]
10+
extern crate structopt_derive;
1111

1212
#[cfg(test)]
1313
#[macro_use]
@@ -113,7 +113,9 @@ fn run_cli(database_url: &str, cli: Cli) -> Result<(), Box<Error>> {
113113
.set((body.eq(new_body), updated_status))
114114
.execute(&conn)?;
115115
}
116-
Cli::AddComment { post_id: given_post_id } => {
116+
Cli::AddComment {
117+
post_id: given_post_id,
118+
} => {
117119
use schema::comments::dsl::*;
118120

119121
let inserted = diesel::insert_into(comments)

0 commit comments

Comments
 (0)