Skip to content
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
4 changes: 2 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,8 @@ jobs:

- name: Install toolchain
run: |
rustup toolchain install 1.83.0
rustup default 1.83.0
rustup toolchain install 1.84.0
rustup default 1.84.0
rustup component add clippy

- name: Setup OPA
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# The Debian version and version name must be in sync
ARG DEBIAN_VERSION=12
ARG DEBIAN_VERSION_NAME=bookworm
ARG RUSTC_VERSION=1.83.0
ARG RUSTC_VERSION=1.84.0
ARG NODEJS_VERSION=20.15.0
ARG OPA_VERSION=0.64.1
ARG CARGO_AUDITABLE_VERSION=0.6.6
Expand Down
4 changes: 2 additions & 2 deletions crates/cli/src/commands/doctor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ See {DOCS_BASE}/setup/homeserver.html",

if !issuer.starts_with("https://") {
warn!(
r#"⚠️ The issuer in the config (`http.issuer`/`http.public_base`) is not an HTTPS URL.
This means some clients will refuse to use it."#
r"⚠️ The issuer in the config (`http.issuer`/`http.public_base`) is not an HTTPS URL.
This means some clients will refuse to use it."
);
}

Expand Down
8 changes: 4 additions & 4 deletions crates/handlers/src/upstream_oauth2/cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,17 @@ impl<'a> LazyProviderInfos<'a> {

/// Trigger the discovery process and return the metadata if discovery is
/// enabled.
pub async fn maybe_discover<'b>(
&'b mut self,
) -> Result<Option<&'b VerifiedProviderMetadata>, DiscoveryError> {
pub async fn maybe_discover(
&mut self,
) -> Result<Option<&VerifiedProviderMetadata>, DiscoveryError> {
match self.load().await {
Ok(metadata) => Ok(Some(metadata)),
Err(DiscoveryError::Disabled) => Ok(None),
Err(e) => Err(e),
}
}

async fn load<'b>(&'b mut self) -> Result<&'b VerifiedProviderMetadata, DiscoveryError> {
async fn load(&mut self) -> Result<&VerifiedProviderMetadata, DiscoveryError> {
if self.loaded_metadata.is_none() {
let verify = match self.provider.discovery_mode {
UpstreamOAuthProviderDiscoveryMode::Oidc => true,
Expand Down
10 changes: 5 additions & 5 deletions crates/handlers/src/upstream_oauth2/link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -429,8 +429,8 @@ pub(crate) async fn get(
let ctx = ErrorContext::new()
.with_code("User exists")
.with_description(format!(
r#"Upstream account provider returned {localpart:?} as username,
which is not linked to that upstream account"#
r"Upstream account provider returned {localpart:?} as username,
which is not linked to that upstream account"
))
.with_language(&locale);

Expand All @@ -449,8 +449,8 @@ pub(crate) async fn get(
let ctx = ErrorContext::new()
.with_code("Policy error")
.with_description(format!(
r#"Upstream account provider returned {localpart:?} as username,
which does not pass the policy check: {res}"#
r"Upstream account provider returned {localpart:?} as username,
which does not pass the policy check: {res}"
))
.with_language(&locale);

Expand Down Expand Up @@ -593,7 +593,7 @@ pub(crate) async fn post(
// Is the email verified according to the upstream provider?
let provider_email_verified = env
.render_str("{{ user.email_verified | string }}", &context)
.map_or(false, |v| v == "true");
.is_ok_and(|v| v == "true");

// Create a template context in case we need to re-render because of an error
let ctx = UpstreamRegister::new(link.clone(), provider.clone());
Expand Down
48 changes: 24 additions & 24 deletions crates/iana-codegen/src/gen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,26 +22,26 @@ pub fn struct_def(
) -> std::fmt::Result {
write!(
f,
r#"/// {}
r"/// {}
///
/// Source: <{}>
#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]"#,
#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]",
section.doc,
section.url.unwrap(),
)?;

if !is_exhaustive {
write!(
f,
r#"
#[non_exhaustive]"#
r"
#[non_exhaustive]"
)?;
}

write!(
f,
r#"
pub enum {} {{"#,
r"
pub enum {} {{",
section.key,
)?;
for member in list {
Expand Down Expand Up @@ -72,9 +72,9 @@ pub fn display_impl(
) -> std::fmt::Result {
write!(
f,
r#"impl core::fmt::Display for {} {{
r"impl core::fmt::Display for {} {{
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {{
match self {{"#,
match self {{",
section.key,
)?;

Expand All @@ -97,10 +97,10 @@ pub fn display_impl(

writeln!(
f,
r#"
r"
}}
}}
}}"#,
}}",
)
}

Expand All @@ -117,11 +117,11 @@ pub fn from_str_impl(
};
write!(
f,
r#"impl core::str::FromStr for {} {{
r"impl core::str::FromStr for {} {{
type Err = {err_ty};

fn from_str(s: &str) -> Result<Self, Self::Err> {{
match s {{"#,
match s {{",
section.key,
)?;

Expand All @@ -137,23 +137,23 @@ pub fn from_str_impl(
if is_exhaustive {
write!(
f,
r#"
_ => Err(crate::ParseError::new()),"#
r"
_ => Err(crate::ParseError::new()),"
)?;
} else {
write!(
f,
r#"
value => Ok(Self::Unknown(value.to_owned())),"#,
r"
value => Ok(Self::Unknown(value.to_owned())),",
)?;
}

writeln!(
f,
r#"
r"
}}
}}
}}"#,
}}",
)
}

Expand All @@ -179,22 +179,22 @@ impl schemars::JsonSchema for {} {{
for member in list {
write!(
f,
r#"
r"
// ---
schemars::schema::SchemaObject {{"#,
schemars::schema::SchemaObject {{",
)?;

if let Some(description) = &member.description {
write!(
f,
r#"
r"
metadata: Some(Box::new(schemars::schema::Metadata {{
description: Some(
// ---
{}.to_owned(),
),
..Default::default()
}})),"#,
}})),",
raw_string(description),
)?;
}
Expand All @@ -212,7 +212,7 @@ impl schemars::JsonSchema for {} {{

writeln!(
f,
r#"
r"
];

let description = {};
Expand All @@ -229,7 +229,7 @@ impl schemars::JsonSchema for {} {{
}}
.into()
}}
}}"#,
}}",
raw_string(section.doc),
)
}
Expand Down
4 changes: 2 additions & 2 deletions crates/iana-codegen/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ impl Display for File {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
writeln!(
f,
r#"// Copyright 2024 New Vector Ltd.
r"// Copyright 2024 New Vector Ltd.
// Copyright 2023, 2024 The Matrix.org Foundation C.I.C.
//
// SPDX-License-Identifier: AGPL-3.0-only
Expand All @@ -86,7 +86,7 @@ impl Display for File {
//! Enums from the {:?} IANA registry
//! See <{}>

// Do not edit this file manually"#,
// Do not edit this file manually",
self.registry_name, self.registry_url,
)?;

Expand Down
2 changes: 1 addition & 1 deletion crates/listener/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ where
let tls = stream.tls_info();

// Figure out if it's HTTP/2 based on the negociated ALPN info
let is_h2 = tls.as_ref().map_or(false, TlsStreamInfo::is_alpn_h2);
let is_h2 = tls.as_ref().is_some_and(TlsStreamInfo::is_alpn_h2);

let info = ConnectionInfo {
tls,
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crates/storage-pg/src/queue/schedule.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ impl QueueScheduleRepository for PgQueueScheduleRepository<'_> {
ScheduleLookup,
r#"
SELECT
queue_schedules.schedule_name,
queue_schedules.schedule_name as "schedule_name!",
Copy link
Member Author

@sandhose sandhose Jan 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure why, but my local sqlx kept complaining about this, even though it's supposed to be NOT NULL already :(

queue_schedules.last_scheduled_at,
queue_jobs.status IN ('completed', 'failed') as last_scheduled_job_completed
FROM queue_schedules
Expand Down
Loading