Add lints
This commit is contained in:
parent
70ec88b824
commit
ec9845577a
5 changed files with 38 additions and 4 deletions
|
|
@ -7,6 +7,9 @@ members = [
|
||||||
"sync_lib"
|
"sync_lib"
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[workspace.package]
|
||||||
|
rust-version = "1.83"
|
||||||
|
|
||||||
[workspace.dependencies]
|
[workspace.dependencies]
|
||||||
serde = { version = "1.0.214", default-features = false, features = ["derive"] }
|
serde = { version = "1.0.214", default-features = false, features = ["derive"] }
|
||||||
thiserror = { version = "1.0.66", default-features = false }
|
thiserror = { version = "1.0.66", default-features = false }
|
||||||
|
|
@ -19,4 +22,36 @@ codegen-units = 1
|
||||||
lto = true
|
lto = true
|
||||||
opt-level = 3
|
opt-level = 3
|
||||||
|
|
||||||
|
[workspace.lints.rust]
|
||||||
|
unsafe_code = "forbid"
|
||||||
|
rust_2018_idioms = { level = "warn", priority = -1 }
|
||||||
|
missing_debug_implementations = "warn"
|
||||||
|
|
||||||
[workspace.lints.clippy]
|
[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"
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
#![no_main]
|
#![no_main]
|
||||||
|
|
||||||
use libfuzzer_sys::fuzz_target;
|
use libfuzzer_sys::fuzz_target;
|
||||||
extern crate reconcile;
|
|
||||||
|
|
||||||
fuzz_target!(|texts: (String, String, String)| {
|
fuzz_target!(|texts: (String, String, String)| {
|
||||||
let (original, left, right) = texts;
|
let (original, left, right) = texts;
|
||||||
|
|
|
||||||
|
|
@ -363,7 +363,7 @@ mod tests {
|
||||||
#[test]
|
#[test]
|
||||||
fn test_apply_delete_with_create() {
|
fn test_apply_delete_with_create() {
|
||||||
let builder = StringBuilder::new("hello world");
|
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");
|
assert_eq!(operation.apply(builder).build(), "hello");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ pub struct StringBuilder<'a> {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl StringBuilder<'_> {
|
impl StringBuilder<'_> {
|
||||||
pub fn new(original: &str) -> StringBuilder {
|
pub fn new(original: &str) -> StringBuilder<'_> {
|
||||||
StringBuilder {
|
StringBuilder {
|
||||||
original,
|
original,
|
||||||
last_old_char_index: 0,
|
last_old_char_index: 0,
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ pub async fn ping(
|
||||||
maybe_auth_header.is_some_and(|auth_header| auth(&state, auth_header.token()).is_ok());
|
maybe_auth_header.is_some_and(|auth_header| auth(&state, auth_header.token()).is_ok());
|
||||||
|
|
||||||
Ok(Json(PingResponse {
|
Ok(Json(PingResponse {
|
||||||
server_version: env!("CARGO_PKG_VERSION").to_string(),
|
server_version: env!("CARGO_PKG_VERSION").to_owned(),
|
||||||
is_authenticated,
|
is_authenticated,
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue