-
-
Notifications
You must be signed in to change notification settings - Fork 895
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 TypedBuilder from db_views and db_views_actor #3637
Conversation
pub async fn list(self) -> Result<Vec<PersonMentionView>, Error> { | ||
let conn = &mut get_conn(self.pool).await?; | ||
impl PersonMentionQuery { | ||
pub async fn list(self, pool: &mut DbPool<'_>) -> Result<Vec<PersonMentionView>, Error> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feared that the code would get much uglier without builder, but this together with derive(Default) is actually a very clean solution.
Wow great find, thanks! If my measurements are correct, this decreases the time for incremental build from 2m 16s to 42s. I will go ahead and merge it immediately because its such a major improvement. |
pub is_mod_or_admin: Option<bool>, | ||
pub show_nsfw: Option<bool>, | ||
pub page: Option<i64>, | ||
pub limit: Option<i64>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Btw the bools dont need to use option as they already default to false. Also other members could work without Option, by deriving Default manually and setting the default values there instead of inside list().
* change pool fields to parameters for list * remove my_person_id and admin fields * Change recipient id to list param * Remove TypedBuilder from db_views and db_views_actor
I noticed that typed-builder is still used in db_schema and utils. If it has such a major negative effect on compile time, we should also get rid of it there. |
When re-running the first cargo clippy command in fix-clippy.sh, the build time of db_views is now 311.1s instead of 1281.9s
Helps with #3610