You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Which makes them pretty unusable in my case and I think most other cases as well. This is a big problem for my application because since we use a lot of blobs.
To demonstrate:
use ion_rs::value::Builder;
use ion_rs::value::owned::Element;
fn main() {
let blob_elem = Element::new_blob("this compiles fine -- arg is already &'static ".as_bytes().into());
println!("{:?}", blob_elem);
let hello_world: Box<[u8]> = "hello, world!".as_bytes().into();
let blob_elem = Element::new_blob(hello_world.as_ref());
// | ^^^^^^^^^^^^^^^^^^^^
// | |
// | borrowed value does not live long enough
// | argument requires that `hello_world` is borrowed for `'static`
println!("{:?}", blob_elem);
}
Note that if you replace the argument with a string literal, i.e. Element::new_blob("hello, world!".into()), it works fine.
The text was updated successfully, but these errors were encountered:
ion-rust/src/value/mod.rs
Lines 552 to 556 in 93da7e4
Which makes them pretty unusable in my case and I think most other cases as well. This is a big problem for my application because since we use a lot of blobs.
To demonstrate:
Note that if you replace the argument with a string literal, i.e.
Element::new_blob("hello, world!".into())
, it works fine.The text was updated successfully, but these errors were encountered: