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

Run clippy linting on tests too #420

Merged
merged 1 commit into from
Dec 11, 2023
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
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,6 @@ jobs:
RUSTDOCFLAGS: "-D warnings"

- name: Cargo clippy
run: cargo clippy --all-features
run: cargo clippy --all-features --tests
env:
RUSTFLAGS: "-D warnings"
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use serde::{Deserialize, Serialize};

#[derive(Serialize, Deserialize, Debug, PartialEq)]
#[cfg_attr(test, derive(Default))]
pub struct IdentityTokenPayloadResponse {
pub access_token: String,
pub expires_in: u64,
Expand All @@ -10,21 +11,3 @@ pub struct IdentityTokenPayloadResponse {

pub(crate) encrypted_payload: String,
}

#[cfg(test)]
mod test {
use super::*;

impl Default for IdentityTokenPayloadResponse {
fn default() -> Self {
Self {
access_token: Default::default(),
expires_in: Default::default(),
refresh_token: Default::default(),
token_type: Default::default(),
scope: Default::default(),
encrypted_payload: Default::default(),
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,27 +1,11 @@
use serde::{Deserialize, Serialize};

#[derive(Serialize, Deserialize, Debug, PartialEq)]
#[cfg_attr(test, derive(Default))]
pub struct IdentityTokenRefreshResponse {
pub access_token: String,
pub expires_in: u64,
pub refresh_token: Option<String>,
token_type: String,
scope: String,
}

#[cfg(test)]
mod test {
use super::*;

impl Default for IdentityTokenRefreshResponse {
fn default() -> Self {
Self {
access_token: Default::default(),
expires_in: Default::default(),
refresh_token: Default::default(),
token_type: Default::default(),
scope: Default::default(),
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ mod test {

#[test]
fn two_factor() {
let expected = Box::new(IdentityTwoFactorResponse::default());
let expected = Box::<IdentityTwoFactorResponse>::default();
let two_factor = serde_json::to_string(&expected).unwrap();
let expected = IdentityTokenResponse::TwoFactorRequired(expected);
let actual = parse_identity_response(StatusCode::BAD_REQUEST, two_factor).unwrap();
Expand Down
2 changes: 1 addition & 1 deletion crates/bitwarden/src/vault/send.rs
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ mod tests {
iterations: 345123.try_into().unwrap(),
},
},
"asdfasdfasdf".into(),
"asdfasdfasdf",
"2.majkL1/hNz9yptLqNAUSnw==|RiOzMTTJMG948qu8O3Zm1EQUO2E8BuTwFKnO9LWQjMzxMWJM5GbyOq2/A+tumPbTERt4JWur/FKfgHb+gXuYiEYlXPMuVBvT7nv4LPytJuM=|IVqMxHJeR1ZXY0sGngTC0x+WqbG8p6V+BTrdgBbQXjM=".parse().unwrap(),
"2.kmLY8NJVuiKBFJtNd/ZFpA==|qOodlRXER+9ogCe3yOibRHmUcSNvjSKhdDuztLlucs10jLiNoVVVAc+9KfNErLSpx5wmUF1hBOJM8zwVPjgQTrmnNf/wuDpwiaCxNYb/0v4FygPy7ccAHK94xP1lfqq7U9+tv+/yiZSwgcT+xF0wFpoxQeNdNRFzPTuD9o4134n8bzacD9DV/WjcrXfRjbBCzzuUGj1e78+A7BWN7/5IWLz87KWk8G7O/W4+8PtEzlwkru6Wd1xO19GYU18oArCWCNoegSmcGn7w7NDEXlwD403oY8Oa7ylnbqGE28PVJx+HLPNIdSC6YKXeIOMnVs7Mctd/wXC93zGxAWD6ooTCzHSPVV50zKJmWIG2cVVUS7j35H3rGDtUHLI+ASXMEux9REZB8CdVOZMzp2wYeiOpggebJy6MKOZqPT1R3X0fqF2dHtRFPXrNsVr1Qt6bS9qTyO4ag1/BCvXF3P1uJEsI812BFAne3cYHy5bIOxuozPfipJrTb5WH35bxhElqwT3y/o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