Skip to content

Commit

Permalink
Remove unnecessary parentheses (#1949)
Browse files Browse the repository at this point in the history
  • Loading branch information
riverar committed Aug 5, 2022
1 parent 104ecd6 commit 4e188c3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions crates/libs/metadata/src/reader/codes.rs
Expand Up @@ -33,7 +33,7 @@ pub enum HasAttribute {
impl HasAttribute {
pub fn encode(&self) -> usize {
(match self {
Self::MethodDef(row) => ((row.0.row + 1) << 5),
Self::MethodDef(row) => (row.0.row + 1) << 5,
Self::Field(row) => ((row.0.row + 1) << 5) | 1,
Self::TypeRef(row) => ((row.0.row + 1) << 5) | 2,
Self::TypeDef(row) => ((row.0.row + 1) << 5) | 3,
Expand All @@ -54,7 +54,7 @@ pub enum HasConstant {
impl HasConstant {
pub fn encode(&self) -> usize {
(match self {
Self::Field(row) => ((row.0.row + 1) << 2),
Self::Field(row) => (row.0.row + 1) << 2,
}) as _
}
}
Expand Down Expand Up @@ -116,7 +116,7 @@ pub enum TypeOrMethodDef {
impl TypeOrMethodDef {
pub fn encode(&self) -> usize {
(match self {
Self::TypeDef(value) => ((value.0.row + 1) << 1),
Self::TypeDef(value) => (value.0.row + 1) << 1,
}) as _
}
}
6 changes: 3 additions & 3 deletions crates/libs/metadata/src/writer/codes.rs
Expand Up @@ -11,7 +11,7 @@ pub enum ResolutionScope {
impl ResolutionScope {
pub fn encode(&self) -> usize {
match self {
Self::Module(row) => ((row + 1) << 2),
Self::Module(row) => (row + 1) << 2,
Self::ModuleRef(row) => ((row + 1) << 2) + 1,
Self::AssemblyRef(row) => ((row + 1) << 2) + 2,
Self::TypeRef(row) => ((row + 1) << 2) + 3,
Expand All @@ -38,7 +38,7 @@ pub enum TypeDefOrRef {
impl TypeDefOrRef {
pub fn encode(&self) -> usize {
match self {
Self::TypeDef(row) => ((row + 1) << 2),
Self::TypeDef(row) => (row + 1) << 2,
Self::TypeRef(row) => ((row + 1) << 2) + 1,
Self::TypeSpec(row) => ((row + 1) << 2) + 2,
_ => 0,
Expand All @@ -64,7 +64,7 @@ pub enum HasConstant {
impl HasConstant {
pub fn encode(&self) -> usize {
match self {
Self::Field(row) => ((row + 1) << 2),
Self::Field(row) => (row + 1) << 2,
Self::Param(row) => ((row + 1) << 2) + 1,
Self::Property(row) => ((row + 1) << 2) + 2,
_ => 0,
Expand Down

0 comments on commit 4e188c3

Please sign in to comment.