Skip to content
This repository has been archived by the owner on Jun 2, 2020. It is now read-only.

Commit

Permalink
Replace unwrap_or() with expect() in commands/new/{command}.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
ajnirp committed Oct 1, 2019
1 parent aa1acfa commit 0553e5c
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion azure-functions-sdk/src/commands/new/blob.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ impl<'a> From<&'a ArgMatches<'a>> for Blob<'a> {
Blob {
name: args.value_of("positional-name").unwrap_or_else(|| {
args.value_of("name")
.unwrap_or("Default fallback - never reached")
.expect("A NAME argument is needed")
}),
path: args.value_of("path").unwrap(),
}
Expand Down
2 changes: 1 addition & 1 deletion azure-functions-sdk/src/commands/new/cosmos_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ impl<'a> From<&'a ArgMatches<'a>> for CosmosDb<'a> {
CosmosDb {
name: args.value_of("positional-name").unwrap_or_else(|| {
args.value_of("name")
.unwrap_or("Default fallback - never reached")
.expect("A NAME argument is needed")
}),
connection: args.value_of("connection").unwrap(),
database: args.value_of("database").unwrap(),
Expand Down
2 changes: 1 addition & 1 deletion azure-functions-sdk/src/commands/new/event_grid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ impl<'a> From<&'a ArgMatches<'a>> for EventGrid<'a> {
EventGrid {
name: args.value_of("positional-name").unwrap_or_else(|| {
args.value_of("name")
.unwrap_or("Default fallback - never reached")
.expect("A NAME argument is needed")
}),
}
}
Expand Down
2 changes: 1 addition & 1 deletion azure-functions-sdk/src/commands/new/event_hub.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ impl<'a> From<&'a ArgMatches<'a>> for EventHub<'a> {
EventHub {
name: args.value_of("positional-name").unwrap_or_else(|| {
args.value_of("name")
.unwrap_or("Default fallback - never reached")
.expect("A NAME argument is needed")
}),
connection: args.value_of("connection").unwrap(),
hub_name: args.value_of("hub_name").unwrap_or(""),
Expand Down
2 changes: 1 addition & 1 deletion azure-functions-sdk/src/commands/new/http.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ impl<'a> From<&'a ArgMatches<'a>> for Http<'a> {
Http {
name: args.value_of("positional-name").unwrap_or_else(|| {
args.value_of("name")
.unwrap_or("Default fallback - never reached")
.expect("A NAME argument is needed")
}),
auth_level: match args.value_of("auth-level") {
Some(level) => {
Expand Down
2 changes: 1 addition & 1 deletion azure-functions-sdk/src/commands/new/queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ impl<'a> From<&'a ArgMatches<'a>> for Queue<'a> {
Queue {
name: args.value_of("positional-name").unwrap_or_else(|| {
args.value_of("name")
.unwrap_or("Default fallback - never reached")
.expect("A NAME argument is needed")
}),
queue_name: args.value_of("queue_name").unwrap(),
}
Expand Down
2 changes: 1 addition & 1 deletion azure-functions-sdk/src/commands/new/service_bus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ impl<'a> From<&'a ArgMatches<'a>> for ServiceBus<'a> {
ServiceBus {
name: args.value_of("positional-name").unwrap_or_else(|| {
args.value_of("name")
.unwrap_or("Default fallback - never reached")
.expect("A NAME argument is needed")
}),
connection: args.value_of("connection").unwrap(),
queue: args.value_of("queue"),
Expand Down
2 changes: 1 addition & 1 deletion azure-functions-sdk/src/commands/new/timer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ impl<'a> From<&'a ArgMatches<'a>> for Timer<'a> {
Timer {
name: args.value_of("positional-name").unwrap_or_else(|| {
args.value_of("name")
.unwrap_or("Default fallback - never reached")
.expect("A NAME argument is needed")
}),
schedule: args.value_of("schedule").unwrap(),
}
Expand Down

0 comments on commit 0553e5c

Please sign in to comment.