diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 60fc453..02fa831 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -2,7 +2,8 @@ name: Release on: push: - tags: "v*" + tags: + - v* jobs: create-release: diff --git a/.vscode/settings.json b/.vscode/settings.json index 17f0f65..1987de2 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -4,5 +4,6 @@ }, "[rust]": { "editor.formatOnSave": true - } + }, + "files.eol": "\n" } diff --git a/Cargo.lock b/Cargo.lock index 88afa4d..3aa1455 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -651,7 +651,7 @@ dependencies = [ [[package]] name = "rbxcloud" -version = "0.2.1" +version = "0.2.2" dependencies = [ "anyhow", "base64", diff --git a/Cargo.toml b/Cargo.toml index 15e71e5..108d2ce 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rbxcloud" -version = "0.2.1" +version = "0.2.2" description = "CLI and SDK for the Roblox Open Cloud APIs" authors = ["Stephen Leitnick"] license = "MIT" diff --git a/examples/datastore-get-entry.rs b/examples/datastore-get-entry.rs index a36032f..4b7cf07 100644 --- a/examples/datastore-get-entry.rs +++ b/examples/datastore-get-entry.rs @@ -24,10 +24,10 @@ async fn main() { // Print entry result or error: match entry_result { Ok(result) => { - println!("{}", result); + println!("{result}"); } Err(e) => { - eprintln!("{:?}", e); + eprintln!("{e:?}"); } } } diff --git a/examples/publish-message.rs b/examples/publish-message.rs index 51b255e..d03b6cf 100644 --- a/examples/publish-message.rs +++ b/examples/publish-message.rs @@ -25,7 +25,7 @@ async fn main() { println!("Message successfully published"); } Err(e) => { - eprintln!("{:?}", e); + eprintln!("{e:?}"); } } diff --git a/examples/publish-place.rs b/examples/publish-place.rs index 4e4d551..321e9dc 100644 --- a/examples/publish-place.rs +++ b/examples/publish-place.rs @@ -20,7 +20,7 @@ async fn main() { println!("Published place! New version: {}", result.version_number); } Err(e) => { - eprintln!("{:?}", e); + eprintln!("{e:?}"); } } } diff --git a/src/cli/datastore_cli.rs b/src/cli/datastore_cli.rs index 3f98509..a45921a 100644 --- a/src/cli/datastore_cli.rs +++ b/src/cli/datastore_cli.rs @@ -302,7 +302,7 @@ impl DataStore { }) .await; match res { - Ok(data) => Ok(Some(format!("{:#?}", data))), + Ok(data) => Ok(Some(format!("{data:#?}"))), Err(err) => Err(err.into()), } } @@ -330,7 +330,7 @@ impl DataStore { }) .await; match res { - Ok(data) => Ok(Some(format!("{:#?}", data))), + Ok(data) => Ok(Some(format!("{data:#?}"))), Err(err) => Err(err.into()), } } @@ -385,7 +385,7 @@ impl DataStore { }) .await; match res { - Ok(data) => Ok(Some(format!("{:#?}", data))), + Ok(data) => Ok(Some(format!("{data:#?}"))), Err(err) => Err(err.into()), } } @@ -414,7 +414,7 @@ impl DataStore { }) .await; match res { - Ok(data) => Ok(Some(format!("{}", data))), + Ok(data) => Ok(Some(format!("{data}"))), Err(err) => Err(err.into()), } } @@ -462,13 +462,13 @@ impl DataStore { key, start_time, end_time, - sort_order: format!("{:?}", sort_order), + sort_order: format!("{sort_order:?}"), limit: ReturnLimit(limit), cursor, }) .await; match res { - Ok(data) => Ok(Some(format!("{:#?}", data))), + Ok(data) => Ok(Some(format!("{data:#?}"))), Err(err) => Err(err.into()), } } diff --git a/src/cli/messaging_cli.rs b/src/cli/messaging_cli.rs index 7a3f341..aad7ae3 100644 --- a/src/cli/messaging_cli.rs +++ b/src/cli/messaging_cli.rs @@ -43,7 +43,7 @@ impl Messaging { let messaging = rbx_cloud.messaging(&topic); let res = messaging.publish(&message).await; match res { - Ok(()) => Ok(Some(format!("published message to topic {}", topic))), + Ok(()) => Ok(Some(format!("published message to topic {topic}"))), Err(err) => Err(anyhow::anyhow!(err)), } } diff --git a/src/main.rs b/src/main.rs index 51081ad..6e9dd45 100644 --- a/src/main.rs +++ b/src/main.rs @@ -11,11 +11,11 @@ async fn main() { match cli_args.run().await { Ok(str) => { if let Some(s) = str { - println!("{}", s); + println!("{s}"); } } Err(err) => { - eprintln!("{:?}", err); + eprintln!("{err:?}"); process::exit(1); } } diff --git a/src/rbx/datastore.rs b/src/rbx/datastore.rs index 9ab6286..7ffc1d7 100644 --- a/src/rbx/datastore.rs +++ b/src/rbx/datastore.rs @@ -244,15 +244,10 @@ async fn handle_res_ok(res: Response) -> Result<(), Error> { fn build_url(endpoint: &str, universe_id: UniverseId) -> String { if endpoint.is_empty() { - format!( - "https://apis.roblox.com/datastores/v1/universes/{universeId}/standard-datastores", - universeId = universe_id, - ) + format!("https://apis.roblox.com/datastores/v1/universes/{universe_id}/standard-datastores",) } else { format!( - "https://apis.roblox.com/datastores/v1/universes/{universeId}/standard-datastores/{endpoint}", - universeId=universe_id, - endpoint=endpoint, + "https://apis.roblox.com/datastores/v1/universes/{universe_id}/standard-datastores{endpoint}", ) } } @@ -260,7 +255,7 @@ fn build_url(endpoint: &str, universe_id: UniverseId) -> String { #[inline] fn get_checksum_base64(data: &String) -> String { let mut md5_hash = Md5::new(); - md5_hash.update(&data.as_bytes()); + md5_hash.update(data.as_bytes()); base64::encode(md5_hash.finalize()) } @@ -350,7 +345,7 @@ fn build_ids_csv(ids: &Option>) -> String { ids.as_ref() .unwrap_or(&vec![]) .iter() - .map(|id| format!("{}", id)) + .map(|id| format!("{id}")) .collect::>() .join(",") } @@ -413,7 +408,7 @@ pub async fn increment_entry(params: &IncrementEntryParams) -> Result for Error { impl std::fmt::Display for Error { fn fmt(&self, f: &mut std::fmt::Formatter) -> Result<(), std::fmt::Error> { match self { - Self::FileLoadError(s) => write!(f, "failed to read file: {}", s), - Self::HttpStatusError { code, msg } => write!(f, "http {}: {}", code, msg), - Self::ReqwestError(e) => write!(f, "{:?}", e), - Self::IOError(e) => write!(f, "{:?}", e), - Self::SerdeJsonError(e) => write!(f, "{:?}", e), - Self::DataStoreError(e) => write!(f, "{:?}", e), - Self::ParseFloatError(e) => write!(f, "{:?}", e), + Self::FileLoadError(s) => write!(f, "failed to read file: {s}"), + Self::HttpStatusError { code, msg } => write!(f, "http {code}: {msg}"), + Self::ReqwestError(e) => write!(f, "{e:?}"), + Self::IOError(e) => write!(f, "{e:?}"), + Self::SerdeJsonError(e) => write!(f, "{e:?}"), + Self::DataStoreError(e) => write!(f, "{e:?}"), + Self::ParseFloatError(e) => write!(f, "{e:?}"), } } } diff --git a/src/rbx/experience.rs b/src/rbx/experience.rs index 23ca33e..7127245 100644 --- a/src/rbx/experience.rs +++ b/src/rbx/experience.rs @@ -20,7 +20,7 @@ pub enum PublishVersionType { impl fmt::Display for PublishVersionType { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "{:?}", self) + write!(f, "{self:?}") } }