Skip to content

Commit

Permalink
fix: minor code + add serde default for tier
Browse files Browse the repository at this point in the history
  • Loading branch information
pxseu committed Aug 5, 2023
1 parent 79d950c commit 2b30ecf
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/commands/ignite/templates.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ pub async fn handle(options: Options, state: State) -> Result<()> {
}

let validator = {
let valid = validator.split('/').into_iter().collect::<Vec<_>>();
let valid = validator.split('/').collect::<Vec<_>>();

if valid.len() == 3 {
valid[1]
Expand Down
3 changes: 2 additions & 1 deletion src/commands/projects/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ pub struct Project {
pub namespace: String,
#[serde(rename = "type")]
pub type_: String,
#[serde(deserialize_with = "deserialize_null_default")]
//@this route does not return this field at all, hence the serde(default)
#[serde(default, deserialize_with = "deserialize_null_default")]
pub tier: ProjectTier,
}

Expand Down
6 changes: 4 additions & 2 deletions src/commands/volumes/copy/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,10 @@ pub async fn get_files_from_volume(
let packed = response
.headers()
.get("x-directory")
.context("No content type header")?
.to_str()?
.map(|x| x.to_str())
.transpose()?
// if the header is not present, assume false (not packed)
.unwrap_or("false")
.to_lowercase()
== "true";

Expand Down

0 comments on commit 2b30ecf

Please sign in to comment.