spelling and clippy fixes
This commit is contained in:
parent
963a3323ea
commit
351bb0741b
|
@ -1,15 +1,19 @@
|
|||
{
|
||||
"cSpell.words": [
|
||||
"bitor",
|
||||
"Creds",
|
||||
"deserialise",
|
||||
"Elefren",
|
||||
"expecteds",
|
||||
"favourite",
|
||||
"favourited",
|
||||
"indoc",
|
||||
"isolang",
|
||||
"querystring",
|
||||
"reblog",
|
||||
"repr",
|
||||
"reqwest",
|
||||
"subscope",
|
||||
"tomlcrate",
|
||||
"tungstenite",
|
||||
"Unauth",
|
||||
|
|
|
@ -193,6 +193,7 @@ mod tests {
|
|||
website: None,
|
||||
};
|
||||
let expected = app.clone();
|
||||
#[allow(clippy::useless_conversion)]
|
||||
let result = app.try_into().expect("Couldn't make App into App");
|
||||
assert_eq!(expected, result);
|
||||
}
|
||||
|
|
|
@ -11,8 +11,7 @@ use serde::ser::{Serialize, Serializer};
|
|||
use crate::errors::Error;
|
||||
use serde::{
|
||||
de::{self, Visitor},
|
||||
Deserialize,
|
||||
Deserializer,
|
||||
Deserialize, Deserializer,
|
||||
};
|
||||
|
||||
/// Represents a set of OAuth scopes
|
||||
|
@ -41,9 +40,7 @@ impl FromStr for Scopes {
|
|||
let scope = Scope::from_str(scope)?;
|
||||
set.insert(scope);
|
||||
}
|
||||
Ok(Scopes {
|
||||
scopes: set,
|
||||
})
|
||||
Ok(Scopes { scopes: set })
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -180,15 +177,13 @@ impl Scopes {
|
|||
/// let read_write = read.and(write);
|
||||
/// ```
|
||||
pub fn and(self, other: Scopes) -> Scopes {
|
||||
let newset: HashSet<_> = self
|
||||
let new_set: HashSet<_> = self
|
||||
.scopes
|
||||
.union(&other.scopes)
|
||||
.into_iter()
|
||||
.copied()
|
||||
.collect();
|
||||
Scopes {
|
||||
scopes: newset,
|
||||
}
|
||||
Scopes { scopes: new_set }
|
||||
}
|
||||
|
||||
fn _write(subscope: Option<Write>) -> Scopes {
|
||||
|
@ -202,9 +197,7 @@ impl Scopes {
|
|||
fn new(scope: Scope) -> Scopes {
|
||||
let mut set = HashSet::new();
|
||||
set.insert(scope);
|
||||
Scopes {
|
||||
scopes: set,
|
||||
}
|
||||
Scopes { scopes: set }
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -780,7 +773,8 @@ mod tests {
|
|||
("push", Scope::Push),
|
||||
];
|
||||
for (source, expected) in &tests {
|
||||
let result = Scope::from_str(source).expect(&format!("Couldn't parse '{}'", &source));
|
||||
let result =
|
||||
Scope::from_str(source).unwrap_or_else(|_| panic!("Couldn't parse '{}'", &source));
|
||||
assert_eq!(result, *expected);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue