Skip to content

Commit

Permalink
housekeeping
Browse files Browse the repository at this point in the history
  • Loading branch information
Lurk committed Sep 28, 2024
1 parent 92af0c3 commit 02459bf
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "cloudinary"
description = "A Rust library for the Cloudinary API"
license = "MIT OR Apache-2.0"
keywords = ["cloudinary", "api", "image", "video", "upload"]
version = "0.5.0"
version = "0.5.1"
edition = "2021"
rust-version = "1.65.0" # due to let-else

Expand All @@ -19,7 +19,7 @@ serde_json = "1.0.108"
sha1 = "0.10.6"
tokio = { version = "1.34.0", features = ["rt", "macros"] }
tokio-util = "0.7.10"
url = "2.4.1"
url = "2.5.2"

[dev-dependencies]
dotenv = "0.15.0"
Expand Down
14 changes: 7 additions & 7 deletions src/transformation/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ impl Image {

let new_file_name = format!("{}.{}", file_name, format);
url.set_path(
path.replace(file_name.as_str(), new_flie_name.as_str())
path.replace(file_name.as_str(), new_file_name.as_str())
.as_str(),
);
}
Expand Down Expand Up @@ -156,7 +156,7 @@ impl TryFrom<Url> for Image {

let mut cloud_name: Option<&str> = None;
let mut public_id_parts: Vec<(&str, Option<&str>)> = Vec::new();
let mut public_id_teritory = false;
let mut public_id_territory = false;
for (pos, s) in url.path_segments().unwrap().enumerate() {
match pos {
0 => {
Expand Down Expand Up @@ -185,14 +185,14 @@ impl TryFrom<Url> for Image {
}
}
_ => {
if !public_id_teritory && is_version(s) {
public_id_teritory = true;
} else if !public_id_teritory && is_transformation(s) {
if !public_id_territory && is_version(s) {
public_id_territory = true;
} else if !public_id_territory && is_transformation(s) {
} else if let Some((head, tail)) = s.rsplit_once('.') {
public_id_teritory = true;
public_id_territory = true;
public_id_parts.push((head, Some(tail)));
} else {
public_id_teritory = true;
public_id_territory = true;
public_id_parts.push((s, None));
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/transformation/named_color.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::fmt::Display;
/// CSS named colors V4.
/// https://www.w3.org/TR/css-color-4/#named-colors
/// <https://www.w3.org/TR/css-color-4/#named-colors>
#[derive(Debug, Clone)]
pub enum NamedColor {
AliceBlue,
Expand Down

0 comments on commit 02459bf

Please sign in to comment.