From e6c1ae83b1a3333ac1010d23f2ec0cf36d794382 Mon Sep 17 00:00:00 2001 From: Alexander Koz Date: Fri, 29 Sep 2023 00:11:07 +0400 Subject: [PATCH] update readme for snd & fs --- Cargo.lock | 20 ++++++++++---------- api/fs/Cargo.toml | 2 +- api/fs/README.md | 2 +- api/sound/Cargo.toml | 2 +- api/sound/README.md | 9 ++++----- api/sound/src/sample.rs | 10 +--------- 6 files changed, 18 insertions(+), 27 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 58045d37..13e493b5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -42,9 +42,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.5.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1f58811cfac344940f1a400b6e6231ce35171f614f26439e80f8c1465c5cc0c" +checksum = "bff2cf94a3dbe2d57cbd56485e1bd7436455058034d6c2d47be51d4e5e4bc6ab" dependencies = [ "anstyle", "anstyle-parse", @@ -80,9 +80,9 @@ dependencies = [ [[package]] name = "anstyle-wincon" -version = "2.1.0" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58f54d10c6dfa51283a066ceab3ec1ab78d13fae00aa49243a45e4571fb79dfd" +checksum = "0238ca56c96dfa37bdf7c373c8886dd591322500aceeeccdb2216fe06dc2f796" dependencies = [ "anstyle", "windows-sys 0.48.0", @@ -469,9 +469,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.4.5" +version = "4.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "824956d0dca8334758a5b7f7e50518d66ea319330cbceedcf76905c2f6ab30e3" +checksum = "d04704f56c2cde07f43e8e2c154b43f216dc5c92fc98ada720177362f953b956" dependencies = [ "clap_builder", "clap_derive", @@ -479,9 +479,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.4.5" +version = "4.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "122ec64120a49b4563ccaedcbea7818d069ed8e9aa6d829b82d8a4128936b2ab" +checksum = "0e231faeaca65ebd1ea3c737966bf858971cd38c3849107aa3ea7de90a804e45" dependencies = [ "anstream", "anstyle", @@ -2586,7 +2586,7 @@ dependencies = [ [[package]] name = "playdate-fs" -version = "0.2.0" +version = "0.2.1" dependencies = [ "playdate-sys", ] @@ -2609,7 +2609,7 @@ dependencies = [ [[package]] name = "playdate-sound" -version = "0.2.2" +version = "0.2.3" dependencies = [ "playdate-fs", "playdate-graphics", diff --git a/api/fs/Cargo.toml b/api/fs/Cargo.toml index 1fffd9c0..43b3ee21 100644 --- a/api/fs/Cargo.toml +++ b/api/fs/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "playdate-fs" -version = "0.2.0" +version = "0.2.1" readme = "README.md" description = "High-level file-system API built on-top of Playdate API" keywords = ["playdate", "sdk", "api", "gamedev"] diff --git a/api/fs/README.md b/api/fs/README.md index f4682f44..87c1485a 100644 --- a/api/fs/README.md +++ b/api/fs/README.md @@ -2,7 +2,7 @@ High-level interface to file-system on-top of `playdate-sys` crate. -⚠️ Until the version `0.3` API is unstable and can be changed partially. +⚠️ Prior to the version `0.3` API is unstable and can be changed without deprecation period. diff --git a/api/sound/Cargo.toml b/api/sound/Cargo.toml index 914238b6..3c94d6ea 100644 --- a/api/sound/Cargo.toml +++ b/api/sound/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "playdate-sound" -version = "0.2.2" +version = "0.2.3" readme = "README.md" description = "High-level sound API built on-top of Playdate API" keywords = ["playdate", "sdk", "api", "gamedev"] diff --git a/api/sound/README.md b/api/sound/README.md index f8fdce8a..53ece946 100644 --- a/api/sound/README.md +++ b/api/sound/README.md @@ -2,14 +2,12 @@ High-level sound API built on-top of [playdate-sys][]. -Covered parts the sound API: +Covered parts of the sound API: - File Player - Sample Player - Sample - Sound Source -- Headphones and microphone (incomplete) 🤏 - -⚠️ __Incomplete__, WiP. +- Headphones and microphone (incomplete) Not covered things: - channel @@ -20,7 +18,7 @@ Not covered things: - envelope - callbacks -Before the version `0.3` API is unstable and can be changed. +⚠️ Prior to the version `0.3` API is unstable and can be changed without deprecation period. ## Prerequisites @@ -33,6 +31,7 @@ Before the version `0.3` API is unstable and can be changed. [sdk]: https://play.date/dev/#cardSDK [doc-prerequisites]: https://sdk.play.date/Inside%20Playdate%20with%20C.html#_prerequisites + ## Usage ```rust diff --git a/api/sound/src/sample.rs b/api/sound/src/sample.rs index bbf69bec..ac806f1e 100644 --- a/api/sound/src/sample.rs +++ b/api/sound/src/sample.rs @@ -102,15 +102,7 @@ impl Sample { pub fn new_for_file_with>(api: Api, path: P) -> Result { let size = match fs::metadata(path) { Ok(stats) => stats.size, - Err(err) => { - return match err { - fs::error::ApiError::Api(err) => Err(ApiError::Api(err.into())), - fs::error::ApiError::Utf8(err) => Err(ApiError::Utf8(err)), - fs::error::ApiError::FromUtf8(err) => Err(ApiError::FromUtf8(err)), - fs::error::ApiError::CStr(err) => Err(ApiError::CStr(err)), - fs::error::ApiError::NullPtr(_) => Err(ApiError::NullPtr(sys::error::NullPtrError)), - } - }, // Err(err) => return Err(ApiError::from_err(err)), + Err(err) => return Err(ApiError::from_err(err)), }; Self::new_with_size_with(api, size as _).map_err(Into::into)