Skip to content

Commit 2717f49

Browse files
committed
Make the ruby_version and rails_version fields of the Cli struct non-optional.
This is because the default values are already set in the struct definition.
1 parent 4826c31 commit 2717f49

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ fn main() {
1616
// read the content of the DOCKERFILE and store it in a variable
1717
let dockerfile = include_bytes!("../Dockerfile");
1818

19-
let ruby_version = cli.ruby_version.unwrap();
20-
let rails_version = cli.rails_version.unwrap();
19+
let ruby_version = cli.ruby_version;
20+
let rails_version = cli.rails_version;
2121

2222
// Run docker build --build-arg RUBY_VERSION=$RUBY_VERSION --build-arg RAILS_VERSION=$RAILS_VERSION -t rails-new-$RUBY_VERSION-$RAILS_VERSION
2323
// passing the content of DOCKERFILE to the command stdin

src/rails_new.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ pub struct Cli {
77
/// arguments passed to `rails new`
88
pub args: Vec<String>,
99
#[clap(long, short = 'u', default_value = "3.2.3")]
10-
pub ruby_version: Option<String>,
10+
pub ruby_version: String,
1111
#[clap(long, short = 'r', default_value = "7.1.3")]
12-
pub rails_version: Option<String>,
12+
pub rails_version: String,
1313
}
1414

1515
#[test]

0 commit comments

Comments
 (0)