Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🌯 fix submodule hierarchy #8

Merged
merged 1 commit into from
Nov 15, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/a.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,12 @@ use super::*; use std::marker::PhantomData as PD;
fn ptr_at_impl<F:Fn(&Self,U,U)->R<U>>(&self,i:U,j:U,f:F)->R<*mut I>{
let(o):isize=f(self,i,j).map(|x|x*size_of::<I>())?.try_into()?;let(d)=unsafe{(self.d.offset(o) as *mut I)};
Ok(d)}
}
}}

/**scalar conversion/comparison*/mod scalars{use super::*; /*todo...*/
impl A<MI>{pub fn as_i(&self)->R<I>{let a@A{m:1,n:1,..}=self else{bail!("not a scalar")};a.get(1,1)}}
#[test]fn scalar_get()->R<()>{let a=A::from_i(42)?;eq!(a.get(1,1)?,42);drop(a);ok!()}
#[test]fn scalar_set()->R<()>{let mut a=A::from_i(42)?;a.set(1,1,420)?;eq!(a.get(1,1)?,420);drop(a);ok!()}}
}

/**slices conversion/comparison*/mod slices{use super::*;
impl A<MI>{ // only allow slice access for initialized arrays
Expand Down