attr_fn_like_width to 60
note the default is documented as 70 but this was not being honored by rustfmt Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
array_width = 80
|
array_width = 80
|
||||||
|
attr_fn_like_width = 60
|
||||||
chain_width = 50
|
chain_width = 50
|
||||||
comment_width = 80
|
comment_width = 80
|
||||||
condense_wildcard_suffixes = true
|
condense_wildcard_suffixes = true
|
||||||
|
|||||||
@@ -6,7 +6,11 @@ pub mod je;
|
|||||||
#[cfg(all(not(target_env = "msvc"), feature = "jemalloc"))]
|
#[cfg(all(not(target_env = "msvc"), feature = "jemalloc"))]
|
||||||
pub use je::{memory_stats, memory_usage, trim};
|
pub use je::{memory_stats, memory_usage, trim};
|
||||||
|
|
||||||
#[cfg(all(not(target_env = "msvc"), feature = "hardened_malloc", not(feature = "jemalloc")))]
|
#[cfg(all(
|
||||||
|
not(target_env = "msvc"),
|
||||||
|
feature = "hardened_malloc",
|
||||||
|
not(feature = "jemalloc")
|
||||||
|
))]
|
||||||
pub mod hardened;
|
pub mod hardened;
|
||||||
#[cfg(all(
|
#[cfg(all(
|
||||||
not(target_env = "msvc"),
|
not(target_env = "msvc"),
|
||||||
|
|||||||
@@ -606,7 +606,10 @@ pub struct Config {
|
|||||||
/// spiders.
|
/// spiders.
|
||||||
///
|
///
|
||||||
/// This is inherently false if `allow_federation` is disabled
|
/// This is inherently false if `allow_federation` is disabled
|
||||||
#[serde(default = "true_fn", alias = "allow_profile_lookup_federation_requests")]
|
#[serde(
|
||||||
|
default = "true_fn",
|
||||||
|
alias = "allow_profile_lookup_federation_requests"
|
||||||
|
)]
|
||||||
pub allow_inbound_profile_lookup_federation_requests: bool,
|
pub allow_inbound_profile_lookup_federation_requests: bool,
|
||||||
|
|
||||||
/// Allow standard users to create rooms. Appservices and admins are always
|
/// Allow standard users to create rooms. Appservices and admins are always
|
||||||
@@ -1827,7 +1830,10 @@ pub struct TlsConfig {
|
|||||||
|
|
||||||
#[allow(rustdoc::broken_intra_doc_links, rustdoc::bare_urls)]
|
#[allow(rustdoc::broken_intra_doc_links, rustdoc::bare_urls)]
|
||||||
#[derive(Clone, Debug, Deserialize, Default)]
|
#[derive(Clone, Debug, Deserialize, Default)]
|
||||||
#[config_example_generator(filename = "tuwunel-example.toml", section = "global.well_known")]
|
#[config_example_generator(
|
||||||
|
filename = "tuwunel-example.toml",
|
||||||
|
section = "global.well_known"
|
||||||
|
)]
|
||||||
pub struct WellKnownConfig {
|
pub struct WellKnownConfig {
|
||||||
/// The server URL that the client well-known file will serve. This should
|
/// The server URL that the client well-known file will serve. This should
|
||||||
/// not contain a port, and should just be a valid HTTPS URL.
|
/// not contain a port, and should just be a valid HTTPS URL.
|
||||||
@@ -1853,7 +1859,10 @@ pub struct WellKnownConfig {
|
|||||||
|
|
||||||
#[derive(Clone, Copy, Debug, Deserialize, Default)]
|
#[derive(Clone, Copy, Debug, Deserialize, Default)]
|
||||||
#[allow(rustdoc::broken_intra_doc_links, rustdoc::bare_urls)]
|
#[allow(rustdoc::broken_intra_doc_links, rustdoc::bare_urls)]
|
||||||
#[config_example_generator(filename = "tuwunel-example.toml", section = "global.blurhashing")]
|
#[config_example_generator(
|
||||||
|
filename = "tuwunel-example.toml",
|
||||||
|
section = "global.blurhashing"
|
||||||
|
)]
|
||||||
pub struct BlurhashConfig {
|
pub struct BlurhashConfig {
|
||||||
/// blurhashing x component, 4 is recommended by https://blurha.sh/
|
/// blurhashing x component, 4 is recommended by https://blurha.sh/
|
||||||
///
|
///
|
||||||
|
|||||||
@@ -1,4 +1,8 @@
|
|||||||
#![allow(clippy::cast_possible_wrap, clippy::cast_sign_loss, clippy::as_conversions)]
|
#![allow(
|
||||||
|
clippy::cast_possible_wrap,
|
||||||
|
clippy::cast_sign_loss,
|
||||||
|
clippy::as_conversions
|
||||||
|
)]
|
||||||
|
|
||||||
use std::{cmp::Ordering, fmt, fmt::Display, str::FromStr};
|
use std::{cmp::Ordering, fmt, fmt::Display, str::FromStr};
|
||||||
|
|
||||||
|
|||||||
@@ -134,7 +134,10 @@ fn deserialize_legacy_power_levels(content: &str) -> Option<RoomPowerLevelsEvent
|
|||||||
|
|
||||||
#[derive(Deserialize)]
|
#[derive(Deserialize)]
|
||||||
pub(crate) struct PowerLevelsContentFields {
|
pub(crate) struct PowerLevelsContentFields {
|
||||||
#[serde(default, deserialize_with = "vec_deserialize_v1_powerlevel_values")]
|
#[serde(
|
||||||
|
default,
|
||||||
|
deserialize_with = "vec_deserialize_v1_powerlevel_values"
|
||||||
|
)]
|
||||||
pub(crate) users: Vec<(OwnedUserId, Int)>,
|
pub(crate) users: Vec<(OwnedUserId, Int)>,
|
||||||
|
|
||||||
#[serde(default, deserialize_with = "deserialize_v1_powerlevel")]
|
#[serde(default, deserialize_with = "deserialize_v1_powerlevel")]
|
||||||
@@ -157,7 +160,10 @@ impl PowerLevelsContentFields {
|
|||||||
|
|
||||||
#[derive(Deserialize)]
|
#[derive(Deserialize)]
|
||||||
struct IntPowerLevelsContentFields {
|
struct IntPowerLevelsContentFields {
|
||||||
#[serde(default, deserialize_with = "vec_deserialize_int_powerlevel_values")]
|
#[serde(
|
||||||
|
default,
|
||||||
|
deserialize_with = "vec_deserialize_int_powerlevel_values"
|
||||||
|
)]
|
||||||
users: Vec<(OwnedUserId, Int)>,
|
users: Vec<(OwnedUserId, Int)>,
|
||||||
|
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
@@ -227,7 +233,10 @@ pub(crate) fn deserialize_power_levels_content_invite(
|
|||||||
|
|
||||||
#[derive(Deserialize)]
|
#[derive(Deserialize)]
|
||||||
pub(crate) struct PowerLevelsContentRedact {
|
pub(crate) struct PowerLevelsContentRedact {
|
||||||
#[serde(default = "default_power_level", deserialize_with = "deserialize_v1_powerlevel")]
|
#[serde(
|
||||||
|
default = "default_power_level",
|
||||||
|
deserialize_with = "deserialize_v1_powerlevel"
|
||||||
|
)]
|
||||||
pub(crate) redact: Int,
|
pub(crate) redact: Int,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -123,7 +123,10 @@ pub fn name_from_path(path: &Path) -> Result<String> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Get the (major, minor) of the block device on which Path is mounted.
|
/// Get the (major, minor) of the block device on which Path is mounted.
|
||||||
#[allow(clippy::useless_conversion, clippy::unnecessary_fallible_conversions)]
|
#[allow(
|
||||||
|
clippy::useless_conversion,
|
||||||
|
clippy::unnecessary_fallible_conversions
|
||||||
|
)]
|
||||||
fn dev_from_path(path: &Path) -> Result<(dev_t, dev_t)> {
|
fn dev_from_path(path: &Path) -> Result<(dev_t, dev_t)> {
|
||||||
#[cfg(target_family = "unix")]
|
#[cfg(target_family = "unix")]
|
||||||
use std::os::unix::fs::MetadataExt;
|
use std::os::unix::fs::MetadataExt;
|
||||||
|
|||||||
@@ -57,7 +57,11 @@ pub fn format(ts: SystemTime, str: &str) -> String {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[must_use]
|
#[must_use]
|
||||||
#[allow(clippy::as_conversions, clippy::cast_possible_truncation, clippy::cast_sign_loss)]
|
#[allow(
|
||||||
|
clippy::as_conversions,
|
||||||
|
clippy::cast_possible_truncation,
|
||||||
|
clippy::cast_sign_loss
|
||||||
|
)]
|
||||||
pub fn pretty(d: Duration) -> String {
|
pub fn pretty(d: Duration) -> String {
|
||||||
use Unit::*;
|
use Unit::*;
|
||||||
|
|
||||||
|
|||||||
@@ -183,7 +183,10 @@ impl<'a, 'de: 'a> de::Deserializer<'de> for &'a mut Deserializer<'de> {
|
|||||||
visitor.visit_seq(self)
|
visitor.visit_seq(self)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg_attr(unabridged, tracing::instrument(level = "trace", skip(self, visitor)))]
|
#[cfg_attr(
|
||||||
|
unabridged,
|
||||||
|
tracing::instrument(level = "trace", skip(self, visitor))
|
||||||
|
)]
|
||||||
fn deserialize_tuple<V>(self, _len: usize, visitor: V) -> Result<V::Value>
|
fn deserialize_tuple<V>(self, _len: usize, visitor: V) -> Result<V::Value>
|
||||||
where
|
where
|
||||||
V: Visitor<'de>,
|
V: Visitor<'de>,
|
||||||
@@ -192,7 +195,10 @@ impl<'a, 'de: 'a> de::Deserializer<'de> for &'a mut Deserializer<'de> {
|
|||||||
visitor.visit_seq(self)
|
visitor.visit_seq(self)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg_attr(unabridged, tracing::instrument(level = "trace", skip(self, visitor)))]
|
#[cfg_attr(
|
||||||
|
unabridged,
|
||||||
|
tracing::instrument(level = "trace", skip(self, visitor))
|
||||||
|
)]
|
||||||
fn deserialize_tuple_struct<V>(
|
fn deserialize_tuple_struct<V>(
|
||||||
self,
|
self,
|
||||||
_name: &'static str,
|
_name: &'static str,
|
||||||
@@ -216,7 +222,10 @@ impl<'a, 'de: 'a> de::Deserializer<'de> for &'a mut Deserializer<'de> {
|
|||||||
d.deserialize_map(visitor).map_err(Into::into)
|
d.deserialize_map(visitor).map_err(Into::into)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg_attr(unabridged, tracing::instrument(level = "trace", skip(self, visitor)))]
|
#[cfg_attr(
|
||||||
|
unabridged,
|
||||||
|
tracing::instrument(level = "trace", skip(self, visitor))
|
||||||
|
)]
|
||||||
fn deserialize_struct<V>(
|
fn deserialize_struct<V>(
|
||||||
self,
|
self,
|
||||||
name: &'static str,
|
name: &'static str,
|
||||||
@@ -232,7 +241,10 @@ impl<'a, 'de: 'a> de::Deserializer<'de> for &'a mut Deserializer<'de> {
|
|||||||
.map_err(Into::into)
|
.map_err(Into::into)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg_attr(unabridged, tracing::instrument(level = "trace", skip(self, visitor)))]
|
#[cfg_attr(
|
||||||
|
unabridged,
|
||||||
|
tracing::instrument(level = "trace", skip(self, visitor))
|
||||||
|
)]
|
||||||
fn deserialize_unit_struct<V>(self, name: &'static str, visitor: V) -> Result<V::Value>
|
fn deserialize_unit_struct<V>(self, name: &'static str, visitor: V) -> Result<V::Value>
|
||||||
where
|
where
|
||||||
V: Visitor<'de>,
|
V: Visitor<'de>,
|
||||||
@@ -246,7 +258,10 @@ impl<'a, 'de: 'a> de::Deserializer<'de> for &'a mut Deserializer<'de> {
|
|||||||
visitor.visit_unit()
|
visitor.visit_unit()
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg_attr(unabridged, tracing::instrument(level = "trace", skip(self, visitor)))]
|
#[cfg_attr(
|
||||||
|
unabridged,
|
||||||
|
tracing::instrument(level = "trace", skip(self, visitor))
|
||||||
|
)]
|
||||||
fn deserialize_newtype_struct<V>(self, name: &'static str, visitor: V) -> Result<V::Value>
|
fn deserialize_newtype_struct<V>(self, name: &'static str, visitor: V) -> Result<V::Value>
|
||||||
where
|
where
|
||||||
V: Visitor<'de>,
|
V: Visitor<'de>,
|
||||||
@@ -261,7 +276,10 @@ impl<'a, 'de: 'a> de::Deserializer<'de> for &'a mut Deserializer<'de> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg_attr(unabridged, tracing::instrument(level = "trace", skip(self, _visitor)))]
|
#[cfg_attr(
|
||||||
|
unabridged,
|
||||||
|
tracing::instrument(level = "trace", skip(self, _visitor))
|
||||||
|
)]
|
||||||
fn deserialize_enum<V>(
|
fn deserialize_enum<V>(
|
||||||
self,
|
self,
|
||||||
_name: &'static str,
|
_name: &'static str,
|
||||||
@@ -436,7 +454,10 @@ impl<'a, 'de: 'a> de::Deserializer<'de> for &'a mut Deserializer<'de> {
|
|||||||
impl<'a, 'de: 'a> de::SeqAccess<'de> for &'a mut Deserializer<'de> {
|
impl<'a, 'de: 'a> de::SeqAccess<'de> for &'a mut Deserializer<'de> {
|
||||||
type Error = Error;
|
type Error = Error;
|
||||||
|
|
||||||
#[cfg_attr(unabridged, tracing::instrument(level = "trace", skip(self, seed)))]
|
#[cfg_attr(
|
||||||
|
unabridged,
|
||||||
|
tracing::instrument(level = "trace", skip(self, seed))
|
||||||
|
)]
|
||||||
fn next_element_seed<T>(&mut self, seed: T) -> Result<Option<T::Value>>
|
fn next_element_seed<T>(&mut self, seed: T) -> Result<Option<T::Value>>
|
||||||
where
|
where
|
||||||
T: DeserializeSeed<'de>,
|
T: DeserializeSeed<'de>,
|
||||||
@@ -455,7 +476,10 @@ impl<'a, 'de: 'a> de::SeqAccess<'de> for &'a mut Deserializer<'de> {
|
|||||||
impl<'a, 'de: 'a> de::MapAccess<'de> for &'a mut Deserializer<'de> {
|
impl<'a, 'de: 'a> de::MapAccess<'de> for &'a mut Deserializer<'de> {
|
||||||
type Error = Error;
|
type Error = Error;
|
||||||
|
|
||||||
#[cfg_attr(unabridged, tracing::instrument(level = "trace", skip(self, seed)))]
|
#[cfg_attr(
|
||||||
|
unabridged,
|
||||||
|
tracing::instrument(level = "trace", skip(self, seed))
|
||||||
|
)]
|
||||||
fn next_key_seed<K>(&mut self, seed: K) -> Result<Option<K::Value>>
|
fn next_key_seed<K>(&mut self, seed: K) -> Result<Option<K::Value>>
|
||||||
where
|
where
|
||||||
K: DeserializeSeed<'de>,
|
K: DeserializeSeed<'de>,
|
||||||
@@ -463,7 +487,10 @@ impl<'a, 'de: 'a> de::MapAccess<'de> for &'a mut Deserializer<'de> {
|
|||||||
seed.deserialize(&mut **self).map(Some)
|
seed.deserialize(&mut **self).map(Some)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg_attr(unabridged, tracing::instrument(level = "trace", skip(self, seed)))]
|
#[cfg_attr(
|
||||||
|
unabridged,
|
||||||
|
tracing::instrument(level = "trace", skip(self, seed))
|
||||||
|
)]
|
||||||
fn next_value_seed<V>(&mut self, seed: V) -> Result<V::Value>
|
fn next_value_seed<V>(&mut self, seed: V) -> Result<V::Value>
|
||||||
where
|
where
|
||||||
V: DeserializeSeed<'de>,
|
V: DeserializeSeed<'de>,
|
||||||
|
|||||||
@@ -124,7 +124,12 @@ impl Engine {
|
|||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
#[must_use]
|
#[must_use]
|
||||||
#[tracing::instrument(name = "sequence", level = "debug", skip_all, fields(sequence))]
|
#[tracing::instrument(
|
||||||
|
name = "sequence",
|
||||||
|
level = "debug",
|
||||||
|
skip_all,
|
||||||
|
fields(sequence)
|
||||||
|
)]
|
||||||
pub fn current_sequence(&self) -> u64 {
|
pub fn current_sequence(&self) -> u64 {
|
||||||
let sequence = self.db.latest_sequence_number();
|
let sequence = self.db.latest_sequence_number();
|
||||||
|
|
||||||
|
|||||||
@@ -268,7 +268,11 @@ pub(crate) fn cache_size(config: &Config, base_size: u32, entity_size: usize) ->
|
|||||||
cache_size_f64(config, f64::from(base_size), entity_size)
|
cache_size_f64(config, f64::from(base_size), entity_size)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(clippy::as_conversions, clippy::cast_sign_loss, clippy::cast_possible_truncation)]
|
#[allow(
|
||||||
|
clippy::as_conversions,
|
||||||
|
clippy::cast_sign_loss,
|
||||||
|
clippy::cast_possible_truncation
|
||||||
|
)]
|
||||||
pub(crate) fn cache_size_f64(config: &Config, base_size: f64, entity_size: usize) -> usize {
|
pub(crate) fn cache_size_f64(config: &Config, base_size: f64, entity_size: usize) -> usize {
|
||||||
let ents = base_size * config.cache_capacity_modifier;
|
let ents = base_size * config.cache_capacity_modifier;
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,10 @@ use crate::{
|
|||||||
};
|
};
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(debug_assertions, should_panic(expected = "serializing string at the top-level"))]
|
#[cfg_attr(
|
||||||
|
debug_assertions,
|
||||||
|
should_panic(expected = "serializing string at the top-level")
|
||||||
|
)]
|
||||||
fn ser_str() {
|
fn ser_str() {
|
||||||
let user_id: &UserId = "@user:example.com".try_into().unwrap();
|
let user_id: &UserId = "@user:example.com".try_into().unwrap();
|
||||||
let s = serialize_to_vec(&user_id).expect("failed to serialize user_id");
|
let s = serialize_to_vec(&user_id).expect("failed to serialize user_id");
|
||||||
@@ -162,7 +165,10 @@ fn ser_json_macro() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(debug_assertions, should_panic(expected = "serializing string at the top-level"))]
|
#[cfg_attr(
|
||||||
|
debug_assertions,
|
||||||
|
should_panic(expected = "serializing string at the top-level")
|
||||||
|
)]
|
||||||
fn ser_json_raw() {
|
fn ser_json_raw() {
|
||||||
use tuwunel_core::ruma::api::client::filter::FilterDefinition;
|
use tuwunel_core::ruma::api::client::filter::FilterDefinition;
|
||||||
|
|
||||||
@@ -179,7 +185,10 @@ fn ser_json_raw() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(debug_assertions, should_panic(expected = "you can skip serialization instead"))]
|
#[cfg_attr(
|
||||||
|
debug_assertions,
|
||||||
|
should_panic(expected = "you can skip serialization instead")
|
||||||
|
)]
|
||||||
fn ser_json_raw_json() {
|
fn ser_json_raw_json() {
|
||||||
use tuwunel_core::ruma::api::client::filter::FilterDefinition;
|
use tuwunel_core::ruma::api::client::filter::FilterDefinition;
|
||||||
|
|
||||||
|
|||||||
@@ -58,15 +58,30 @@ pub(crate) struct Args {
|
|||||||
pub(crate) worker_threads: usize,
|
pub(crate) worker_threads: usize,
|
||||||
|
|
||||||
/// Override the tokio global_queue_interval.
|
/// Override the tokio global_queue_interval.
|
||||||
#[arg(long, hide(true), env = "TOKIO_GLOBAL_QUEUE_INTERVAL", default_value = "192")]
|
#[arg(
|
||||||
|
long,
|
||||||
|
hide(true),
|
||||||
|
env = "TOKIO_GLOBAL_QUEUE_INTERVAL",
|
||||||
|
default_value = "192"
|
||||||
|
)]
|
||||||
pub(crate) global_event_interval: u32,
|
pub(crate) global_event_interval: u32,
|
||||||
|
|
||||||
/// Override the tokio event_interval.
|
/// Override the tokio event_interval.
|
||||||
#[arg(long, hide(true), env = "TOKIO_EVENT_INTERVAL", default_value = "512")]
|
#[arg(
|
||||||
|
long,
|
||||||
|
hide(true),
|
||||||
|
env = "TOKIO_EVENT_INTERVAL",
|
||||||
|
default_value = "512"
|
||||||
|
)]
|
||||||
pub(crate) kernel_event_interval: u32,
|
pub(crate) kernel_event_interval: u32,
|
||||||
|
|
||||||
/// Override the tokio max_io_events_per_tick.
|
/// Override the tokio max_io_events_per_tick.
|
||||||
#[arg(long, hide(true), env = "TOKIO_MAX_IO_EVENTS_PER_TICK", default_value = "512")]
|
#[arg(
|
||||||
|
long,
|
||||||
|
hide(true),
|
||||||
|
env = "TOKIO_MAX_IO_EVENTS_PER_TICK",
|
||||||
|
default_value = "512"
|
||||||
|
)]
|
||||||
pub(crate) kernel_events_per_tick: usize,
|
pub(crate) kernel_events_per_tick: usize,
|
||||||
|
|
||||||
/// Set the histogram bucket size, in microseconds (tokio_unstable). Default
|
/// Set the histogram bucket size, in microseconds (tokio_unstable). Default
|
||||||
@@ -74,11 +89,21 @@ pub(crate) struct Args {
|
|||||||
/// with the exception of the last bucket, try increasing this value to e.g.
|
/// with the exception of the last bucket, try increasing this value to e.g.
|
||||||
/// 50 or 100. Inversely, decrease to 10 etc if the histogram lacks
|
/// 50 or 100. Inversely, decrease to 10 etc if the histogram lacks
|
||||||
/// resolution.
|
/// resolution.
|
||||||
#[arg(long, hide(true), env = "TUWUNEL_RUNTIME_HISTOGRAM_INTERVAL", default_value = "25")]
|
#[arg(
|
||||||
|
long,
|
||||||
|
hide(true),
|
||||||
|
env = "TUWUNEL_RUNTIME_HISTOGRAM_INTERVAL",
|
||||||
|
default_value = "25"
|
||||||
|
)]
|
||||||
pub(crate) worker_histogram_interval: u64,
|
pub(crate) worker_histogram_interval: u64,
|
||||||
|
|
||||||
/// Set the histogram bucket count (tokio_unstable). Default is 20.
|
/// Set the histogram bucket count (tokio_unstable). Default is 20.
|
||||||
#[arg(long, hide(true), env = "TUWUNEL_RUNTIME_HISTOGRAM_BUCKETS", default_value = "20")]
|
#[arg(
|
||||||
|
long,
|
||||||
|
hide(true),
|
||||||
|
env = "TUWUNEL_RUNTIME_HISTOGRAM_BUCKETS",
|
||||||
|
default_value = "20"
|
||||||
|
)]
|
||||||
pub(crate) worker_histogram_buckets: usize,
|
pub(crate) worker_histogram_buckets: usize,
|
||||||
|
|
||||||
/// Toggles worker affinity feature.
|
/// Toggles worker affinity feature.
|
||||||
|
|||||||
@@ -92,7 +92,10 @@ pub(crate) fn init(
|
|||||||
};
|
};
|
||||||
|
|
||||||
#[cfg(not(feature = "perf_measurements"))]
|
#[cfg(not(feature = "perf_measurements"))]
|
||||||
#[cfg_attr(not(feature = "perf_measurements"), allow(clippy::let_unit_value))]
|
#[cfg_attr(
|
||||||
|
not(feature = "perf_measurements"),
|
||||||
|
allow(clippy::let_unit_value)
|
||||||
|
)]
|
||||||
let flame_guard = ();
|
let flame_guard = ();
|
||||||
|
|
||||||
let ret = (reload_handles, flame_guard, cap_state);
|
let ret = (reload_handles, flame_guard, cap_state);
|
||||||
|
|||||||
@@ -179,7 +179,11 @@ fn base(config: &Config) -> Result<reqwest::ClientBuilder> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(any(target_os = "android", target_os = "fuchsia", target_os = "linux"))]
|
#[cfg(any(
|
||||||
|
target_os = "android",
|
||||||
|
target_os = "fuchsia",
|
||||||
|
target_os = "linux"
|
||||||
|
))]
|
||||||
fn builder_interface(
|
fn builder_interface(
|
||||||
builder: reqwest::ClientBuilder,
|
builder: reqwest::ClientBuilder,
|
||||||
config: Option<&str>,
|
config: Option<&str>,
|
||||||
@@ -191,7 +195,11 @@ fn builder_interface(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(not(any(target_os = "android", target_os = "fuchsia", target_os = "linux")))]
|
#[cfg(not(any(
|
||||||
|
target_os = "android",
|
||||||
|
target_os = "fuchsia",
|
||||||
|
target_os = "linux"
|
||||||
|
)))]
|
||||||
fn builder_interface(
|
fn builder_interface(
|
||||||
builder: reqwest::ClientBuilder,
|
builder: reqwest::ClientBuilder,
|
||||||
config: Option<&str>,
|
config: Option<&str>,
|
||||||
|
|||||||
@@ -16,17 +16,35 @@ use super::Service;
|
|||||||
|
|
||||||
#[derive(Serialize, Default)]
|
#[derive(Serialize, Default)]
|
||||||
pub struct UrlPreviewData {
|
pub struct UrlPreviewData {
|
||||||
#[serde(skip_serializing_if = "Option::is_none", rename(serialize = "og:title"))]
|
#[serde(
|
||||||
|
skip_serializing_if = "Option::is_none",
|
||||||
|
rename(serialize = "og:title")
|
||||||
|
)]
|
||||||
pub title: Option<String>,
|
pub title: Option<String>,
|
||||||
#[serde(skip_serializing_if = "Option::is_none", rename(serialize = "og:description"))]
|
#[serde(
|
||||||
|
skip_serializing_if = "Option::is_none",
|
||||||
|
rename(serialize = "og:description")
|
||||||
|
)]
|
||||||
pub description: Option<String>,
|
pub description: Option<String>,
|
||||||
#[serde(skip_serializing_if = "Option::is_none", rename(serialize = "og:image"))]
|
#[serde(
|
||||||
|
skip_serializing_if = "Option::is_none",
|
||||||
|
rename(serialize = "og:image")
|
||||||
|
)]
|
||||||
pub image: Option<String>,
|
pub image: Option<String>,
|
||||||
#[serde(skip_serializing_if = "Option::is_none", rename(serialize = "matrix:image:size"))]
|
#[serde(
|
||||||
|
skip_serializing_if = "Option::is_none",
|
||||||
|
rename(serialize = "matrix:image:size")
|
||||||
|
)]
|
||||||
pub image_size: Option<usize>,
|
pub image_size: Option<usize>,
|
||||||
#[serde(skip_serializing_if = "Option::is_none", rename(serialize = "og:image:width"))]
|
#[serde(
|
||||||
|
skip_serializing_if = "Option::is_none",
|
||||||
|
rename(serialize = "og:image:width")
|
||||||
|
)]
|
||||||
pub image_width: Option<u32>,
|
pub image_width: Option<u32>,
|
||||||
#[serde(skip_serializing_if = "Option::is_none", rename(serialize = "og:image:height"))]
|
#[serde(
|
||||||
|
skip_serializing_if = "Option::is_none",
|
||||||
|
rename(serialize = "og:image:height")
|
||||||
|
)]
|
||||||
pub image_height: Option<u32>,
|
pub image_height: Option<u32>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,11 @@ pub(crate) struct Hooked {
|
|||||||
type ResolvingResult = Result<Addrs, Box<dyn std::error::Error + Send + Sync>>;
|
type ResolvingResult = Result<Addrs, Box<dyn std::error::Error + Send + Sync>>;
|
||||||
|
|
||||||
impl Resolver {
|
impl Resolver {
|
||||||
#[allow(clippy::as_conversions, clippy::cast_sign_loss, clippy::cast_possible_truncation)]
|
#[allow(
|
||||||
|
clippy::as_conversions,
|
||||||
|
clippy::cast_sign_loss,
|
||||||
|
clippy::cast_possible_truncation
|
||||||
|
)]
|
||||||
pub(super) fn build(server: &Arc<Server>, cache: Arc<Cache>) -> Result<Arc<Self>> {
|
pub(super) fn build(server: &Arc<Server>, cache: Arc<Cache>) -> Result<Arc<Self>> {
|
||||||
let config = &server.config;
|
let config = &server.config;
|
||||||
let (sys_conf, mut opts) = hickory_resolver::system_conf::read_system_conf()
|
let (sys_conf, mut opts) = hickory_resolver::system_conf::read_system_conf()
|
||||||
|
|||||||
@@ -31,7 +31,11 @@ type NameBuf = ArrayString<256>;
|
|||||||
|
|
||||||
#[async_trait]
|
#[async_trait]
|
||||||
impl crate::Service for Service {
|
impl crate::Service for Service {
|
||||||
#[allow(clippy::as_conversions, clippy::cast_sign_loss, clippy::cast_possible_truncation)]
|
#[allow(
|
||||||
|
clippy::as_conversions,
|
||||||
|
clippy::cast_sign_loss,
|
||||||
|
clippy::cast_possible_truncation
|
||||||
|
)]
|
||||||
fn build(args: crate::Args<'_>) -> Result<Arc<Self>> {
|
fn build(args: crate::Args<'_>) -> Result<Arc<Self>> {
|
||||||
let cache = Cache::new(&args);
|
let cache = Cache::new(&args);
|
||||||
Ok(Arc::new(Self {
|
Ok(Arc::new(Self {
|
||||||
|
|||||||
@@ -519,7 +519,11 @@ impl Service {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Look for read receipts in this room
|
/// Look for read receipts in this room
|
||||||
#[tracing::instrument(name = "receipts", level = "trace", skip(self, since, max_edu_count))]
|
#[tracing::instrument(
|
||||||
|
name = "receipts",
|
||||||
|
level = "trace",
|
||||||
|
skip(self, since, max_edu_count)
|
||||||
|
)]
|
||||||
async fn select_edus_receipts_room(
|
async fn select_edus_receipts_room(
|
||||||
&self,
|
&self,
|
||||||
room_id: &RoomId,
|
room_id: &RoomId,
|
||||||
|
|||||||
@@ -184,7 +184,10 @@ impl Service {
|
|||||||
|
|
||||||
/// Returns an iterator over all users on this homeserver (offered for
|
/// Returns an iterator over all users on this homeserver (offered for
|
||||||
/// compatibility)
|
/// compatibility)
|
||||||
#[allow(clippy::iter_without_into_iter, clippy::iter_not_returning_iterator)]
|
#[allow(
|
||||||
|
clippy::iter_without_into_iter,
|
||||||
|
clippy::iter_not_returning_iterator
|
||||||
|
)]
|
||||||
pub fn iter(&self) -> impl Stream<Item = OwnedUserId> + Send + '_ {
|
pub fn iter(&self) -> impl Stream<Item = OwnedUserId> + Send + '_ {
|
||||||
self.stream().map(ToOwned::to_owned)
|
self.stream().map(ToOwned::to_owned)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user