Refactor.
This commit is contained in:
@@ -919,6 +919,7 @@ impl<A: Into<Self>> AddAssign<A> for AST {
|
||||
|
||||
impl AsRef<[Stmt]> for AST {
|
||||
#[inline(always)]
|
||||
#[must_use]
|
||||
fn as_ref(&self) -> &[Stmt] {
|
||||
self.statements()
|
||||
}
|
||||
@@ -927,6 +928,7 @@ impl AsRef<[Stmt]> for AST {
|
||||
#[cfg(not(feature = "no_function"))]
|
||||
impl AsRef<crate::Module> for AST {
|
||||
#[inline(always)]
|
||||
#[must_use]
|
||||
fn as_ref(&self) -> &crate::Module {
|
||||
self.shared_lib().as_ref()
|
||||
}
|
||||
@@ -935,6 +937,7 @@ impl AsRef<crate::Module> for AST {
|
||||
#[cfg(not(feature = "no_function"))]
|
||||
impl AsRef<crate::Shared<crate::Module>> for AST {
|
||||
#[inline(always)]
|
||||
#[must_use]
|
||||
fn as_ref(&self) -> &crate::Shared<crate::Module> {
|
||||
self.shared_lib()
|
||||
}
|
||||
|
@@ -257,6 +257,7 @@ impl Hash for FloatWrapper<crate::FLOAT> {
|
||||
#[cfg(not(feature = "no_float"))]
|
||||
impl<F: Float> AsRef<F> for FloatWrapper<F> {
|
||||
#[inline(always)]
|
||||
#[must_use]
|
||||
fn as_ref(&self) -> &F {
|
||||
&self.0
|
||||
}
|
||||
@@ -265,6 +266,7 @@ impl<F: Float> AsRef<F> for FloatWrapper<F> {
|
||||
#[cfg(not(feature = "no_float"))]
|
||||
impl<F: Float> AsMut<F> for FloatWrapper<F> {
|
||||
#[inline(always)]
|
||||
#[must_use]
|
||||
fn as_mut(&mut self) -> &mut F {
|
||||
&mut self.0
|
||||
}
|
||||
@@ -275,6 +277,7 @@ impl<F: Float> Deref for FloatWrapper<F> {
|
||||
type Target = F;
|
||||
|
||||
#[inline(always)]
|
||||
#[must_use]
|
||||
fn deref(&self) -> &Self::Target {
|
||||
&self.0
|
||||
}
|
||||
@@ -283,6 +286,7 @@ impl<F: Float> Deref for FloatWrapper<F> {
|
||||
#[cfg(not(feature = "no_float"))]
|
||||
impl<F: Float> DerefMut for FloatWrapper<F> {
|
||||
#[inline(always)]
|
||||
#[must_use]
|
||||
fn deref_mut(&mut self) -> &mut Self::Target {
|
||||
&mut self.0
|
||||
}
|
||||
|
@@ -28,6 +28,7 @@ impl fmt::Debug for Ident {
|
||||
|
||||
impl AsRef<str> for Ident {
|
||||
#[inline(always)]
|
||||
#[must_use]
|
||||
fn as_ref(&self) -> &str {
|
||||
self.name.as_ref()
|
||||
}
|
||||
@@ -37,6 +38,7 @@ impl Deref for Ident {
|
||||
type Target = ImmutableString;
|
||||
|
||||
#[inline(always)]
|
||||
#[must_use]
|
||||
fn deref(&self) -> &Self::Target {
|
||||
&self.name
|
||||
}
|
||||
@@ -44,6 +46,7 @@ impl Deref for Ident {
|
||||
|
||||
impl DerefMut for Ident {
|
||||
#[inline(always)]
|
||||
#[must_use]
|
||||
fn deref_mut(&mut self) -> &mut Self::Target {
|
||||
&mut self.name
|
||||
}
|
||||
|
@@ -70,6 +70,7 @@ impl Deref for Namespace {
|
||||
type Target = StaticVec<Ident>;
|
||||
|
||||
#[inline(always)]
|
||||
#[must_use]
|
||||
fn deref(&self) -> &Self::Target {
|
||||
&self.path
|
||||
}
|
||||
@@ -77,6 +78,7 @@ impl Deref for Namespace {
|
||||
|
||||
impl DerefMut for Namespace {
|
||||
#[inline(always)]
|
||||
#[must_use]
|
||||
fn deref_mut(&mut self) -> &mut Self::Target {
|
||||
&mut self.path
|
||||
}
|
||||
|
@@ -424,6 +424,7 @@ impl Deref for StmtBlock {
|
||||
type Target = StmtBlockContainer;
|
||||
|
||||
#[inline(always)]
|
||||
#[must_use]
|
||||
fn deref(&self) -> &Self::Target {
|
||||
&self.block
|
||||
}
|
||||
@@ -431,6 +432,7 @@ impl Deref for StmtBlock {
|
||||
|
||||
impl DerefMut for StmtBlock {
|
||||
#[inline(always)]
|
||||
#[must_use]
|
||||
fn deref_mut(&mut self) -> &mut Self::Target {
|
||||
&mut self.block
|
||||
}
|
||||
@@ -438,6 +440,7 @@ impl DerefMut for StmtBlock {
|
||||
|
||||
impl AsRef<[Stmt]> for StmtBlock {
|
||||
#[inline(always)]
|
||||
#[must_use]
|
||||
fn as_ref(&self) -> &[Stmt] {
|
||||
&self.block
|
||||
}
|
||||
@@ -445,6 +448,7 @@ impl AsRef<[Stmt]> for StmtBlock {
|
||||
|
||||
impl AsMut<[Stmt]> for StmtBlock {
|
||||
#[inline(always)]
|
||||
#[must_use]
|
||||
fn as_mut(&mut self) -> &mut [Stmt] {
|
||||
&mut self.block
|
||||
}
|
||||
|
Reference in New Issue
Block a user