Skip to content

Commit bd10c97

Browse files
committed
move Bucket around
1 parent 5383f51 commit bd10c97

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/publish_rate_limit.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,6 @@ impl Default for PublishRateLimit {
3939
}
4040
}
4141

42-
#[derive(Queryable, Insertable, Debug, PartialEq, Clone, Copy)]
43-
#[diesel(table_name = publish_limit_buckets, check_for_backend(diesel::pg::Pg))]
44-
#[allow(dead_code)] // Most fields only read in tests
45-
struct Bucket {
46-
user_id: i32,
47-
tokens: i32,
48-
last_refill: NaiveDateTime,
49-
action: LimitedAction,
50-
}
51-
5242
impl PublishRateLimit {
5343
pub fn check_rate_limit(&self, uploader: i32, conn: &mut PgConnection) -> AppResult<()> {
5444
let bucket = self.take_token(uploader, Utc::now().naive_utc(), conn)?;
@@ -115,6 +105,16 @@ impl PublishRateLimit {
115105
}
116106
}
117107

108+
#[derive(Queryable, Insertable, Debug, PartialEq, Clone, Copy)]
109+
#[diesel(table_name = publish_limit_buckets, check_for_backend(diesel::pg::Pg))]
110+
#[allow(dead_code)] // Most fields only read in tests
111+
struct Bucket {
112+
user_id: i32,
113+
tokens: i32,
114+
last_refill: NaiveDateTime,
115+
action: LimitedAction,
116+
}
117+
118118
#[cfg(test)]
119119
mod tests {
120120
use super::*;

0 commit comments

Comments
 (0)