Skip to content

Commit

Permalink
Rename Array::from to Array::new_from to avoid collision with From::f…
Browse files Browse the repository at this point in the history
…rom.
  • Loading branch information
Dirbaio committed Apr 5, 2024
1 parent 3ec2c84 commit 6081ff9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions java-spaghetti/src/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ where
fn set_region(&self, start: usize, elements: &[T]);

/// Uses env.New{Type}Array + Set{Type}ArrayRegion to create a new java array containing a copy of "elements".
fn from<'env>(env: Env<'env>, elements: &[T]) -> Local<'env, Self> {
fn new_from<'env>(env: Env<'env>, elements: &[T]) -> Local<'env, Self> {
let array = Self::new(env, elements.len());
array.set_region(0, elements);
array
Expand Down Expand Up @@ -101,7 +101,7 @@ macro_rules! primitive_array {
}
}

fn from<'env>(env: Env<'env>, elements: &[$type]) -> Local<'env, Self> {
fn new_from<'env>(env: Env<'env>, elements: &[$type]) -> Local<'env, Self> {
let array = Self::new(env, elements.len());
let size = elements.len() as jsize;
let env = array.0.env;
Expand Down Expand Up @@ -209,7 +209,7 @@ impl<T: ReferenceType, E: ThrowableType> ObjectArray<T, E> {
}
}

pub fn from<'env>(
pub fn new_from<'env>(
env: Env<'env>,
elements: impl ExactSizeIterator + Iterator<Item = impl AsArg<T>>,
) -> Local<'env, Self> {
Expand Down

0 comments on commit 6081ff9

Please sign in to comment.