Skip to content
This repository has been archived by the owner on Sep 16, 2024. It is now read-only.

[Rustfmt] Remove Deprecated Tags report_fixme and report_todo from Configuration #82

Merged
merged 2 commits into from
Feb 16, 2024
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
2 changes: 0 additions & 2 deletions rustfmt.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ single_line_if_else_max_width = 30

force_explicit_abi = true

report_todo = "Always"
report_fixme = "Always"

reorder_imports = true

Expand Down
3 changes: 2 additions & 1 deletion src/atomic/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ pub struct ReadOnlyFile {
pub path: PathBuf,
}

/// This struct is the only way to read the file. Both path and version are private
/// This struct is the only way to read the file. Both path and version are
/// private
impl ReadOnlyFile {
/// Open the underlying file, which can be read from but not written to.
/// May return `Ok(None)`, which means that no version
Expand Down
6 changes: 4 additions & 2 deletions src/atomic/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ mod tests {
let current = file.load().unwrap();
let content = format!("Content from thread {i}!");
(&temp).write_all(content.as_bytes()).unwrap();
// In case slow computer ensure each thread are running in the same time
// In case slow computer ensure each thread are running in the
// same time
std::thread::sleep(std::time::Duration::from_millis(300));
file.compare_and_swap(&current, temp)
});
Expand Down Expand Up @@ -108,7 +109,8 @@ mod tests {
let shared_file = std::sync::Arc::new(AtomicFile::new(root).unwrap());
let thread_number = 10;
assert!(thread_number > 3);
// Need to have less than 255 thread to store thread number as byte directly
// Need to have less than 255 thread to store thread number as byte
// directly
assert!(thread_number < 256);
let mut handles = Vec::with_capacity(thread_number);
for i in 0..thread_number {
Expand Down
5 changes: 4 additions & 1 deletion src/index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,10 @@ impl ResourceIndex {
};

// We should not return early in case of missing files
for line in BufReader::new(file).lines().flatten() {
let lines = BufReader::new(file).lines();
for line in lines {
let line = line?;

let mut parts = line.split(' ');

let modified = {
Expand Down
3 changes: 2 additions & 1 deletion src/storage/prop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ pub fn store_properties<
let new_value = serde_json::to_value(properties).unwrap();
match current_data {
Some(old_data) => {
// Should not failed unless serialize failed which should never happen
// Should not failed unless serialize failed which should never
// happen
let old_value = serde_json::to_value(old_data).unwrap();
*current_data = Some(merge(old_value, new_value));
}
Expand Down
Loading