Skip to content

Commit

Permalink
remove unneeded map_err from db methods (#64)
Browse files Browse the repository at this point in the history
  • Loading branch information
circuitsacul authored Sep 6, 2022
1 parent 2ae9cd4 commit b387b4b
Show file tree
Hide file tree
Showing 13 changed files with 1 addition and 14 deletions.
1 change: 0 additions & 1 deletion src/database/models/autostar_channel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ impl AutoStarChannel {
)
.fetch_one(pool)
.await
.map_err(|e| e.into())
}

pub async fn delete(
Expand Down
1 change: 0 additions & 1 deletion src/database/models/guild.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,5 @@ impl Guild {
)
.fetch_one(pool)
.await
.map_err(|e| e.into())
}
}
1 change: 0 additions & 1 deletion src/database/models/member.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,5 @@ impl Member {
)
.fetch_one(pool)
.await
.map_err(|e| e.into())
}
}
1 change: 0 additions & 1 deletion src/database/models/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ impl Message {
)
.fetch_one(pool)
.await
.map_err(|e| e.into())
}

pub async fn get_original(pool: &sqlx::PgPool, message_id: i64) -> sqlx::Result<Option<Self>> {
Expand Down
1 change: 0 additions & 1 deletion src/database/models/patron.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,5 @@ impl Patron {
)
.fetch_one(pool)
.await
.map_err(|e| e.into())
}
}
1 change: 0 additions & 1 deletion src/database/models/permrole.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,5 @@ impl PermRole {
)
.fetch_one(pool)
.await
.map_err(|e| e.into())
}
}
1 change: 0 additions & 1 deletion src/database/models/permrole_starboard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,5 @@ impl PermRoleStarboard {
)
.fetch_one(pool)
.await
.map_err(|e| e.into())
}
}
1 change: 0 additions & 1 deletion src/database/models/posrole.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,5 @@ impl PosRole {
)
.fetch_one(pool)
.await
.map_err(|e| e.into())
}
}
1 change: 0 additions & 1 deletion src/database/models/posrole_member.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,5 @@ impl PosRoleMember {
)
.fetch_one(pool)
.await
.map_err(|e| e.into())
}
}
1 change: 0 additions & 1 deletion src/database/models/starboard_message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ impl StarboardMessage {
)
.fetch_one(pool)
.await
.map_err(|e| e.into())
}

pub async fn delete(
Expand Down
3 changes: 1 addition & 2 deletions src/database/models/starboard_override.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ impl StarboardOverride {
)
.fetch_one(pool)
.await
.map_err(|e| e.into())
}

pub async fn list_by_starboard_and_channels(
Expand Down Expand Up @@ -68,6 +67,6 @@ impl StarboardOverride {
}

pub fn get_overrides(&self) -> serde_json::Result<OverrideValues> {
serde_json::from_value(self.overrides.clone()).map_err(|e| e.into())
serde_json::from_value(self.overrides.clone())
}
}
1 change: 0 additions & 1 deletion src/database/models/user.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ impl User {
)
.fetch_one(pool)
.await
.map_err(|e| e.into())
}

pub async fn get(pool: &sqlx::PgPool, user_id: i64) -> sqlx::Result<Option<Self>> {
Expand Down
1 change: 0 additions & 1 deletion src/database/models/xprole.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,5 @@ impl XPRole {
)
.fetch_one(pool)
.await
.map_err(|e| e.into())
}
}

0 comments on commit b387b4b

Please sign in to comment.