Skip to content

Commit f32a66f

Browse files
heftigreivilibre
authored andcommitted
Fix Clippy warnings with Rust 1.86.0
Signed-off-by: Jan Alexander Steffens (heftig) <[email protected]>
1 parent d81b2b9 commit f32a66f

File tree

6 files changed

+12
-10
lines changed

6 files changed

+12
-10
lines changed

compressor_integration_tests/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ pub fn empty_database() {
9898
/// Safely escape the strings in sql queries
9999
struct PGEscape<'a>(pub &'a str);
100100

101-
impl<'a> fmt::Display for PGEscape<'a> {
101+
impl fmt::Display for PGEscape<'_> {
102102
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
103103
let mut delim = Cow::from("$$");
104104
while self.0.contains(&delim as &str) {

src/database.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ fn load_level_heads(client: &mut Client, level_info: &[Level]) -> BTreeMap<i64,
192192
/// specific room within a certain range. These are appended onto the provided
193193
/// map.
194194
///
195-
/// - Fetches the first [group] rows with group id after [min]
195+
/// - Fetches the first `[group]` rows with group id after `[min]`
196196
/// - Recursively searches for missing predecessors and adds those
197197
///
198198
/// Returns with the state_group map and the id of the last group that was used
@@ -206,7 +206,6 @@ fn load_level_heads(client: &mut Client, level_info: &[Level]) -> BTreeMap<i64,
206206
/// also requires groups_to_compress to be specified
207207
/// * 'max_group_found' - The last group to get from the database before stopping
208208
/// * 'state_group_map' - The map to populate with the entries from the database
209-
210209
fn load_map_from_db(
211210
client: &mut Client,
212211
room_id: &str,
@@ -326,7 +325,7 @@ fn find_max_group(
326325
/// Fetch the entries in state_groups_state and immediate predecessors for
327326
/// a specific room.
328327
///
329-
/// - Fetches first [groups_to_compress] rows with group id higher than min
328+
/// - Fetches first `[groups_to_compress]` rows with group id higher than min
330329
/// - Stores the group id, predecessor id and deltas into a map
331330
/// - returns map and maximum row that was considered
332331
///
@@ -467,7 +466,7 @@ fn get_missing_from_db(
467466
/// Helper function that escapes the wrapped text when writing SQL
468467
pub struct PGEscape<'a>(pub &'a str);
469468

470-
impl<'a> fmt::Display for PGEscape<'a> {
469+
impl fmt::Display for PGEscape<'_> {
471470
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
472471
let mut delim = Cow::from("$$");
473472
while self.0.contains(&delim as &str) {

src/graphing.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
use std::collections::BTreeMap;
2-
use std::{fs::File, io::Write};
1+
use std::{collections::BTreeMap, fs::File, io::Write};
32

43
use super::StateGroupEntry;
54

src/lib.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15+
// FIXME: Rewrite argument lists to not trigger this lint.
16+
#![allow(clippy::doc_overindented_list_items)]
17+
1518
//! This is a tool that attempts to further compress state maps within a
1619
//! Synapse instance's database. Specifically, it aims to reduce the number of
1720
//! rows that a given room takes up in the `state_groups_state` table.
@@ -304,7 +307,6 @@ impl Config {
304307
/// # Arguments
305308
///
306309
/// * `config: Config` - A Config struct that controlls the run
307-
308310
pub fn run(mut config: Config) {
309311
// First we need to get the current state groups
310312
info!("Fetching state from DB for room '{}'...", config.room_id);

src/main.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@
2121
static GLOBAL: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc;
2222

2323
use log::LevelFilter;
24-
use std::env;
25-
use std::io::Write;
24+
use std::{env, io::Write};
2625

2726
use synapse_compress_state as comp_state;
2827

synapse_auto_compressor/src/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// FIXME: Rewrite argument lists to not trigger this lint.
2+
#![allow(clippy::doc_overindented_list_items)]
3+
14
//! This is a tool that uses the synapse_compress_state library to
25
//! reduce the size of the synapse state_groups_state table in a postgres
36
//! database.

0 commit comments

Comments
 (0)