mirror of
https://github.com/ellmau/adf-obdd.git
synced 2025-12-20 09:39:38 +01:00
Satisfy clippy for server code
This commit is contained in:
parent
565683721d
commit
ba752514ce
@ -44,9 +44,9 @@ pub(crate) struct AcAndGraph {
|
||||
pub(crate) graph: DoubleLabeledGraph,
|
||||
}
|
||||
|
||||
impl Into<Bson> for AcAndGraph {
|
||||
fn into(self) -> Bson {
|
||||
to_bson(&self).expect("Serialization should work")
|
||||
impl From<AcAndGraph> for Bson {
|
||||
fn from(source: AcAndGraph) -> Self {
|
||||
to_bson(&source).expect("Serialization should work")
|
||||
}
|
||||
}
|
||||
|
||||
@ -297,9 +297,7 @@ async fn add_adf_problem(
|
||||
Parsing::Naive => Adf::from_parser(&parser),
|
||||
Parsing::Hybrid => {
|
||||
let bd_adf = BdAdf::from_parser(&parser);
|
||||
let naive_adf = bd_adf.hybrid_step_opt(false);
|
||||
|
||||
naive_adf
|
||||
bd_adf.hybrid_step_opt(false)
|
||||
}
|
||||
};
|
||||
|
||||
@ -324,8 +322,7 @@ async fn add_adf_problem(
|
||||
Ok(Err(err)) => HttpResponse::InternalServerError().body(err.to_string()),
|
||||
Ok(Ok(Err(err))) => HttpResponse::InternalServerError().body(err.to_string()),
|
||||
Ok(Ok(Ok((adf, ac_and_graph)))) => {
|
||||
let mut acs = AcsPerStrategy::default();
|
||||
acs.parse_only = Some(vec![ac_and_graph]);
|
||||
let acs = AcsPerStrategy { parse_only: Some(vec![ac_and_graph]), ..Default::default()};
|
||||
|
||||
let adf_problem: AdfProblem = AdfProblem {
|
||||
name: problem_name,
|
||||
|
||||
@ -40,7 +40,7 @@ async fn main() -> std::io::Result<()> {
|
||||
// cookie secret ket
|
||||
let secret_key = Key::generate();
|
||||
|
||||
let server = HttpServer::new(move || {
|
||||
HttpServer::new(move || {
|
||||
let app = App::new();
|
||||
|
||||
#[cfg(feature = "cors_for_local_development")]
|
||||
@ -89,7 +89,5 @@ async fn main() -> std::io::Result<()> {
|
||||
})
|
||||
.bind(("0.0.0.0", 8080))?
|
||||
.run()
|
||||
.await;
|
||||
|
||||
server
|
||||
.await
|
||||
}
|
||||
|
||||
@ -280,7 +280,7 @@ async fn update_user(
|
||||
Some(id) => match id.id() {
|
||||
Err(err) => HttpResponse::InternalServerError().body(err.to_string()),
|
||||
Ok(username) => {
|
||||
if &user.username != &username && username_exists(&user_coll, &user.username).await
|
||||
if user.username != username && username_exists(&user_coll, &user.username).await
|
||||
{
|
||||
return HttpResponse::Conflict()
|
||||
.body("Username is already taken. Please pick another one!");
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user