Skip to content
This repository has been archived by the owner on Aug 3, 2023. It is now read-only.

Commit

Permalink
Merge pull request #134 from cloudflare/nullable-scripts-in-routes
Browse files Browse the repository at this point in the history
fix(route): script is nullable (sad)
  • Loading branch information
ashleygwilliams authored May 24, 2019
2 parents 644ca01 + e3916e3 commit f43091c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/commands/publish/route.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use log::info;

#[derive(Deserialize, Serialize)]
pub struct Route {
script: String,
script: Option<String>,
pattern: String,
}

Expand All @@ -22,7 +22,7 @@ impl Route {
);
let script = &user.settings.clone().project.name;
Ok(Route {
script: script.to_string(),
script: Some(script.to_string()),
pattern: pattern.to_string(),
})
}
Expand Down Expand Up @@ -85,7 +85,8 @@ fn create(user: &User, route: Route) -> Result<(), failure::Error> {

info!(
"Creating your route {} for script {}",
route.pattern, route.script
route.pattern,
route.script.unwrap()
);
let mut res = client
.post(&routes_addr)
Expand Down

0 comments on commit f43091c

Please sign in to comment.