Skip to content

Commit

Permalink
Make Clippy happy for 1.79 Rust
Browse files Browse the repository at this point in the history
  • Loading branch information
tyranron committed Jun 19, 2024
1 parent 9bdf8cf commit a3a17bf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
14 changes: 4 additions & 10 deletions juniper/src/http/graphiql.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,19 @@ pub fn graphiql_source(
graphql_endpoint_url: &str,
subscriptions_endpoint_url: Option<&str>,
) -> String {
let subscriptions_endpoint = if let Some(sub_url) = subscriptions_endpoint_url {
sub_url
} else {
""
};

include_str!("graphiql.html").replace(
"<!-- inject -->",
&format!(
// language=JavaScript
"
var JUNIPER_URL = '{graphql_url}';
var JUNIPER_SUBSCRIPTIONS_URL = '{graphql_subscriptions_url}';
var JUNIPER_URL = '{juniper_url}';
var JUNIPER_SUBSCRIPTIONS_URL = '{juniper_subscriptions_url}';
{grahiql_js}
",
graphql_url = graphql_endpoint_url,
graphql_subscriptions_url = subscriptions_endpoint,
juniper_url = graphql_endpoint_url,
juniper_subscriptions_url = subscriptions_endpoint_url.unwrap_or_default(),
grahiql_js = include_str!("graphiql.js"),
),
)
Expand Down
2 changes: 1 addition & 1 deletion juniper/src/types/scalars.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::{char, fmt, marker::PhantomData, ops::Deref, rc::Rc, thread::JoinHandle, u32};
use std::{char, fmt, marker::PhantomData, ops::Deref, rc::Rc, thread::JoinHandle};

use serde::{Deserialize, Serialize};

Expand Down

0 comments on commit a3a17bf

Please sign in to comment.