diff --git a/backend/Cargo.toml b/backend/Cargo.toml index 357ac58a..2aad6f49 100644 --- a/backend/Cargo.toml +++ b/backend/Cargo.toml @@ -7,6 +7,9 @@ members = [ "sync_lib" ] +[workspace.package] +rust-version = "1.83" + [workspace.dependencies] serde = { version = "1.0.214", default-features = false, features = ["derive"] } thiserror = { version = "1.0.66", default-features = false } @@ -19,4 +22,36 @@ codegen-units = 1 lto = true opt-level = 3 +[workspace.lints.rust] +unsafe_code = "forbid" +rust_2018_idioms = { level = "warn", priority = -1 } +missing_debug_implementations = "warn" + [workspace.lints.clippy] +await_holding_lock = "warn" +dbg_macro = "warn" +empty_enum = "warn" +enum_glob_use = "warn" +exit = "warn" +filter_map_next = "warn" +fn_params_excessive_bools = "warn" +if_let_mutex = "warn" +imprecise_flops = "warn" +inefficient_to_string = "warn" +linkedlist = "warn" +lossy_float_literal = "warn" +macro_use_imports = "warn" +match_on_vec_items = "warn" +match_wildcard_for_single_variants = "warn" +mem_forget = "warn" +needless_borrow = "warn" +needless_continue = "warn" +option_option = "warn" +rest_pat_in_fully_bound_structs = "warn" +str_to_string = "warn" +suboptimal_flops = "warn" +todo = "warn" +uninlined_format_args = "warn" +unnested_or_patterns = "warn" +unused_self = "warn" +verbose_file_reads = "warn" \ No newline at end of file diff --git a/backend/fuzz/fuzz_targets/reconcile.rs b/backend/fuzz/fuzz_targets/reconcile.rs index b97c7827..b30d9f57 100644 --- a/backend/fuzz/fuzz_targets/reconcile.rs +++ b/backend/fuzz/fuzz_targets/reconcile.rs @@ -1,7 +1,6 @@ #![no_main] use libfuzzer_sys::fuzz_target; -extern crate reconcile; fuzz_target!(|texts: (String, String, String)| { let (original, left, right) = texts; diff --git a/backend/reconcile/src/operation_transformation/operation.rs b/backend/reconcile/src/operation_transformation/operation.rs index 9a434eb7..e37e119e 100644 --- a/backend/reconcile/src/operation_transformation/operation.rs +++ b/backend/reconcile/src/operation_transformation/operation.rs @@ -363,7 +363,7 @@ mod tests { #[test] fn test_apply_delete_with_create() { let builder = StringBuilder::new("hello world"); - let operation = Operation::<()>::create_delete_with_text(5, " world".to_string()).unwrap(); + let operation = Operation::<()>::create_delete_with_text(5, " world".to_owned()).unwrap(); assert_eq!(operation.apply(builder).build(), "hello"); } diff --git a/backend/reconcile/src/utils/string_builder.rs b/backend/reconcile/src/utils/string_builder.rs index 3394faca..6e3a4b49 100644 --- a/backend/reconcile/src/utils/string_builder.rs +++ b/backend/reconcile/src/utils/string_builder.rs @@ -11,7 +11,7 @@ pub struct StringBuilder<'a> { } impl StringBuilder<'_> { - pub fn new(original: &str) -> StringBuilder { + pub fn new(original: &str) -> StringBuilder<'_> { StringBuilder { original, last_old_char_index: 0, diff --git a/backend/sync_server/src/server/ping.rs b/backend/sync_server/src/server/ping.rs index b3a0c80e..c8b48bd0 100644 --- a/backend/sync_server/src/server/ping.rs +++ b/backend/sync_server/src/server/ping.rs @@ -16,7 +16,7 @@ pub async fn ping( maybe_auth_header.is_some_and(|auth_header| auth(&state, auth_header.token()).is_ok()); Ok(Json(PingResponse { - server_version: env!("CARGO_PKG_VERSION").to_string(), + server_version: env!("CARGO_PKG_VERSION").to_owned(), is_authenticated, })) }