Skip to content

Commit 120ab47

Browse files
committed
move Bucket around
1 parent 133fce7 commit 120ab47

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
@@ -37,16 +37,6 @@ impl Default for PublishRateLimit {
3737
}
3838
}
3939

40-
#[derive(Queryable, Insertable, Debug, PartialEq, Clone, Copy)]
41-
#[table_name = "publish_limit_buckets"]
42-
#[allow(dead_code)] // Most fields only read in tests
43-
struct Bucket {
44-
user_id: i32,
45-
tokens: i32,
46-
last_refill: NaiveDateTime,
47-
action: LimitedAction,
48-
}
49-
5040
impl PublishRateLimit {
5141
pub fn check_rate_limit(&self, uploader: i32, conn: &PgConnection) -> AppResult<()> {
5242
let bucket = self.take_token(uploader, Utc::now().naive_utc(), conn)?;
@@ -123,6 +113,16 @@ impl PublishRateLimit {
123113
}
124114
}
125115

116+
#[derive(Queryable, Insertable, Debug, PartialEq, Clone, Copy)]
117+
#[table_name = "publish_limit_buckets"]
118+
#[allow(dead_code)] // Most fields only read in tests
119+
struct Bucket {
120+
user_id: i32,
121+
tokens: i32,
122+
last_refill: NaiveDateTime,
123+
action: LimitedAction,
124+
}
125+
126126
#[cfg(test)]
127127
mod tests {
128128
use super::*;

0 commit comments

Comments
 (0)