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 unneeded map_err from db methods #64

Merged
merged 1 commit into from
Sep 6, 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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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())
}
}