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

chore: update to Rust 1.64.0 #1415

Merged
merged 2 commits into from
Oct 5, 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
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ commands:
jobs:
checks:
docker:
- image: cimg/rust:1.60.0
- image: cimg/rust:1.64.0
auth:
username: $DOCKER_USER
password: $DOCKER_PASS
Expand All @@ -176,7 +176,7 @@ jobs:

build-and-test:
docker:
- image: cimg/rust:1.60.0
- image: cimg/rust:1.64.0
auth:
username: $DOCKER_USER
password: $DOCKER_PASS
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM rust:1.60-buster as builder
FROM rust:1.64-buster as builder
WORKDIR /app
ADD . /app
ENV PATH=$PATH:/root/.cargo/bin
Expand Down
2 changes: 1 addition & 1 deletion syncstorage-db-common/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ impl<'a> Clone for Box<dyn Db<'a>> {
}
}

#[derive(Debug, Deserialize, Clone, PartialEq, Copy)]
#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Copy)]
#[serde(rename_all = "lowercase")]
pub enum Sorting {
None,
Expand Down
2 changes: 1 addition & 1 deletion syncstorage-db-common/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ fn ms_since_epoch() -> i64 {
/// Sync Timestamp
///
/// Internally represents a Sync timestamp as a u64 representing milliseconds since the epoch.
#[derive(Copy, Clone, Debug, PartialEq, PartialOrd, Deserialize, Serialize, FromSqlRow)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, PartialOrd, Deserialize, Serialize, FromSqlRow)]
pub struct SyncTimestamp(
#[serde(deserialize_with = "deserialize_ts", serialize_with = "serialize_ts")] u64,
);
Expand Down
4 changes: 2 additions & 2 deletions syncstorage/src/server/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ async fn post_collection() {
let bytes =
test_endpoint_with_body(http::Method::POST, "/1.5/42/storage/bookmarks", res_body).await;
let result: PostBsos =
serde_json::from_slice(&bytes.to_vec()).expect("Could not get result in post_collection");
serde_json::from_slice(&bytes).expect("Could not get result in post_collection");
assert!(result.modified >= start);
assert_eq!(result.success.len(), 1);
assert_eq!(result.failed.len(), 0);
Expand Down Expand Up @@ -461,7 +461,7 @@ async fn bsos_can_have_a_collection_field() {
{"id": "2", "collection": "foo", "payload": "SomePayload"},
]);
let bytes = test_endpoint_with_body(http::Method::POST, "/1.5/42/storage/meta", bsos).await;
let result: PostBsos = serde_json::from_slice(&bytes.to_vec())
let result: PostBsos = serde_json::from_slice(&bytes)
.expect("Could not get result in bsos_can_have_a_collection_field");
assert_eq!(result.success.len(), 2);
assert_eq!(result.failed.len(), 0);
Expand Down
2 changes: 1 addition & 1 deletion syncstorage/src/tokenserver/auth/browserid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use crate::tokenserver::settings::Settings;
use std::{convert::TryFrom, time::Duration};

/// The information extracted from a valid BrowserID assertion.
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq)]
pub struct VerifyOutput {
pub device_id: Option<String>,
pub email: String,
Expand Down
2 changes: 1 addition & 1 deletion syncstorage/src/tokenserver/auth/oauth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use core::time::Duration;
use std::convert::TryFrom;

/// The information extracted from a valid OAuth token.
#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
#[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)]
pub struct VerifyOutput {
#[serde(rename = "user")]
pub fxa_uid: String,
Expand Down
6 changes: 3 additions & 3 deletions syncstorage/src/tokenserver/db/results.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ pub struct GetRawUser {

pub type GetUsers = Vec<GetRawUser>;

#[derive(Debug, Default, PartialEq)]
#[derive(Debug, Default, Eq, PartialEq)]
pub struct AllocateUser {
pub uid: i64,
pub node: String,
Expand All @@ -35,7 +35,7 @@ pub struct AllocateUser {
/// Represents the relevant information from the most recently-created user record in the database
/// for a given email and service ID, along with any previously-seen client states seen for the
/// user.
#[derive(Debug, Default, PartialEq)]
#[derive(Debug, Default, Eq, PartialEq)]
pub struct GetOrCreateUser {
pub uid: i64,
pub email: String,
Expand Down Expand Up @@ -83,7 +83,7 @@ pub struct GetServiceId {
}

#[cfg(test)]
#[derive(Debug, Default, PartialEq, QueryableByName)]
#[derive(Debug, Default, Eq, PartialEq, QueryableByName)]
pub struct GetUser {
#[sql_type = "Integer"]
#[column_name = "service"]
Expand Down
4 changes: 2 additions & 2 deletions syncstorage/src/tokenserver/extractors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ lazy_static! {
const SYNC_SERVICE_NAME: &str = "sync-1.5";

/// Information from the request needed to process a Tokenserver request.
#[derive(Debug, Default, PartialEq)]
#[derive(Debug, Default, Eq, PartialEq)]
pub struct TokenserverRequest {
pub user: results::GetOrCreateUser,
pub auth_data: AuthData,
Expand Down Expand Up @@ -414,7 +414,7 @@ impl FromRequest for Token {
}

/// The data extracted from the authentication token.
#[derive(Debug, Default, PartialEq)]
#[derive(Debug, Default, Eq, PartialEq)]
pub struct AuthData {
pub client_state: String,
pub device_id: Option<String>,
Expand Down
2 changes: 1 addition & 1 deletion syncstorage/src/tokenserver/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ impl ServerState {

pub struct TokenserverMetrics(Metrics);

#[derive(Clone, Copy, Debug, Deserialize, PartialEq, Serialize)]
#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
pub enum NodeType {
#[serde(rename = "mysql")]
MySql,
Expand Down
10 changes: 5 additions & 5 deletions syncstorage/src/web/extractors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1179,7 +1179,7 @@ impl FromRequest for HawkIdentifier {
}
}

#[derive(Debug, Default, Clone, Copy, Deserialize, Validate, PartialEq)]
#[derive(Debug, Default, Clone, Copy, Deserialize, Eq, PartialEq, Validate)]
#[serde(default)]
pub struct Offset {
pub timestamp: Option<SyncTimestamp>,
Expand Down Expand Up @@ -1481,14 +1481,14 @@ impl FromRequest for BatchRequestOpt {
/// both.
///
/// Used with Option<PreConditionHeader> to extract a possible PreConditionHeader.
#[derive(Debug, Clone, PartialEq)]
#[derive(Debug, Clone, Eq, PartialEq)]
pub enum PreConditionHeader {
IfModifiedSince(SyncTimestamp),
IfUnmodifiedSince(SyncTimestamp),
NoHeader,
}

#[derive(Debug, Clone, PartialEq)]
#[derive(Debug, Clone, Eq, PartialEq)]
pub struct PreConditionHeaderOpt {
pub opt: Option<PreConditionHeader>,
}
Expand Down Expand Up @@ -1576,7 +1576,7 @@ impl FromRequest for PreConditionHeaderOpt {
}

/// Validation Error Location in the request
#[derive(Debug, Deserialize, Serialize, PartialEq)]
#[derive(Debug, Deserialize, Serialize, Eq, PartialEq)]
#[serde(rename_all = "lowercase")]
pub enum RequestErrorLocation {
Body,
Expand Down Expand Up @@ -1628,7 +1628,7 @@ fn validate_qs_commit(commit: &str) -> Result<(), ValidationError> {

/// Verifies the BSO sortindex is in the valid range
fn validate_body_bso_sortindex(sort: i32) -> Result<(), ValidationError> {
if BSO_MIN_SORTINDEX_VALUE <= sort && sort <= BSO_MAX_SORTINDEX_VALUE {
if (BSO_MIN_SORTINDEX_VALUE..=BSO_MAX_SORTINDEX_VALUE).contains(&sort) {
Ok(())
} else {
Err(request_error("invalid value", RequestErrorLocation::Body))
Expand Down
2 changes: 1 addition & 1 deletion tokenserver-common/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ impl TokenserverError {
}
}

#[derive(Clone, Copy, Debug, PartialEq)]
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum ErrorLocation {
Header,
Url,
Expand Down