mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-25 06:18:45 +08:00
feat(native): sync yocto codes (#14243)
#### PR Dependency Tree * **PR #14243** 👈 This tree was auto-generated by [Charcoal](https://github.com/danerwilliams/charcoal) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Batch management API for coordinated document mutations and change tracking. * New document accessors (IDs, state snapshots, change/delete set queries) and subscriber count. * **Chores** * Upgraded Rust edition across packages to 2024. * Repository-wide formatting, stylistic cleanups and test adjustments. * **Breaking Changes** * Removed the Node native bindings package and its JS/TS declarations and tests (no longer published/available). <sub>✏️ Tip: You can customize this high-level summary in your review settings.</sub> <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
use std::{io::Cursor, path::Path};
|
||||
|
||||
use napi::{
|
||||
bindgen_prelude::{AbortSignal, AsyncTask, Float32Array, Result, Status, Uint8Array},
|
||||
Task,
|
||||
bindgen_prelude::{AbortSignal, AsyncTask, Float32Array, Result, Status, Uint8Array},
|
||||
};
|
||||
use napi_derive::napi;
|
||||
use rubato::{Resampler, SincFixedIn, SincInterpolationParameters, SincInterpolationType};
|
||||
@@ -26,9 +26,7 @@ fn decode<B: AsRef<[u8]> + Send + Sync + 'static>(
|
||||
|
||||
// Create a probe hint using the file extension
|
||||
let mut hint = Hint::new();
|
||||
if let Some(ext) =
|
||||
filename.and_then(|filename| Path::new(filename).extension().and_then(|ext| ext.to_str()))
|
||||
{
|
||||
if let Some(ext) = filename.and_then(|filename| Path::new(filename).extension().and_then(|ext| ext.to_str())) {
|
||||
hint.with_extension(ext);
|
||||
}
|
||||
|
||||
@@ -106,9 +104,7 @@ fn decode<B: AsRef<[u8]> + Send + Sync + 'static>(
|
||||
let mut waves_out = resampler
|
||||
.process(&waves_in, None)
|
||||
.map_err(|_| Error::Unsupported("Failed to run resampler"))?;
|
||||
output = waves_out
|
||||
.pop()
|
||||
.ok_or(Error::Unsupported("No resampled output found"))?;
|
||||
output = waves_out.pop().ok_or(Error::Unsupported("No resampled output found"))?;
|
||||
}
|
||||
|
||||
Ok(output)
|
||||
|
||||
Reference in New Issue
Block a user