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

Remove unnecessary parentheses #1949

Merged
merged 1 commit into from Aug 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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