vec not required

This commit is contained in:
Toshit Chawda 2024-01-11 09:49:27 -08:00
parent eb511a317d
commit f92062c5f5
No known key found for this signature in database
GPG key ID: 91480ED99E2B3D9D
2 changed files with 2 additions and 1 deletions

View file

@ -92,7 +92,7 @@ pub fn entries_of_object(obj: &Object) -> Vec<Vec<String>> {
} }
pub fn define_property_obj(value: JsValue, writable: bool) -> Result<Object, JsValue> { pub fn define_property_obj(value: JsValue, writable: bool) -> Result<Object, JsValue> {
let entries: Array = vec![ let entries: Array = [
Array::of2(&jval!("value"), &jval!(value)), Array::of2(&jval!("value"), &jval!(value)),
Array::of2(&jval!("writable"), &jval!(writable)), Array::of2(&jval!("writable"), &jval!(writable)),
] ]

View file

@ -13,6 +13,7 @@
const t1 = performance.now(); const t1 = performance.now();
console.warn(resp); console.warn(resp);
console.warn(await fetch("https://httpbin.org/post", { method: "POST", body: "test", headers: { "X-Header-One": "one", "x-header-one": "One", "X-Header-Two": "two" } }));
console.warn(Object.fromEntries(resp.headers)); console.warn(Object.fromEntries(resp.headers));
console.warn(await resp.text()); console.warn(await resp.text());
console.warn(`mux 1 took ${t1 - t0} ms or ${(t1 - t0) / 1000} s`); console.warn(`mux 1 took ${t1 - t0} ms or ${(t1 - t0) / 1000} s`);