Make Clippy happy for 1.79 Rust

This commit is contained in:
tyranron 2024-06-19 12:53:35 +02:00
parent 9bdf8cf379
commit a3a17bf6e5
No known key found for this signature in database
GPG key ID: 762E144FB230A4F0
2 changed files with 5 additions and 11 deletions

View file

@ -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"),
),
)

View file

@ -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};