This is an automated email from the ASF dual-hosted git repository.
suyanhanx pushed a commit to branch nodejs-stream
in repository https://gitbox.apache.org/repos/asf/incubator-opendal.git
The following commit(s) were added to refs/heads/nodejs-stream by this push:
new f3f4989a5 format
f3f4989a5 is described below
commit f3f4989a5553ed9354e56ba7a876a1221fc5b58d
Author: suyanhanx <[email protected]>
AuthorDate: Fri Nov 24 15:33:29 2023 +0800
format
Signed-off-by: suyanhanx <[email protected]>
---
bindings/nodejs/src/lib.rs | 6 ++----
bindings/nodejs/tests/suites/sync.suite.mjs | 4 ++--
2 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/bindings/nodejs/src/lib.rs b/bindings/nodejs/src/lib.rs
index da8bbb574..027f574bb 100644
--- a/bindings/nodejs/src/lib.rs
+++ b/bindings/nodejs/src/lib.rs
@@ -212,7 +212,7 @@ impl Operator {
}
#[napi]
- pub fn writer_sync(&self, path: String) -> Result<BlockingWriter>{
+ pub fn writer_sync(&self, path: String) -> Result<BlockingWriter> {
let w = self.0.blocking().writer(&path).map_err(format_napi_error)?;
Ok(BlockingWriter(w))
}
@@ -632,7 +632,7 @@ impl Metadata {
pub struct BlockingWriter(opendal::BlockingWriter);
#[napi]
-impl BlockingWriter{
+impl BlockingWriter {
/// # Safety
///
/// > &mut self in async napi methods should be marked as unsafe
@@ -702,8 +702,6 @@ impl Writer {
self.0.write(c).await.map_err(format_napi_error)
}
-
-
/// # Safety
///
/// > &mut self in async napi methods should be marked as unsafe
diff --git a/bindings/nodejs/tests/suites/sync.suite.mjs
b/bindings/nodejs/tests/suites/sync.suite.mjs
index 6710dc289..ee614c567 100644
--- a/bindings/nodejs/tests/suites/sync.suite.mjs
+++ b/bindings/nodejs/tests/suites/sync.suite.mjs
@@ -40,12 +40,12 @@ export function run(op) {
}
const filename = `random_file_${randomUUID()}`
- const r = fs.createReadStream(path.resolve(__dirname,
'../fixtures/random.txt'))
+ const r = fs.createReadStream(path.resolve(__dirname,
'../fixtures/random'))
const w = new WriterStream(op, filename)
r.pipe(w)
w.on('finish', () => {
const t = op.statSync(filename)
- assert.equal(t.contentLength, fs.statSync(path.resolve(__dirname,
'../fixtures/random.txt')).size)
+ assert.equal(t.contentLength, fs.statSync(path.resolve(__dirname,
'../fixtures/random')).size)
})
})
}