Skip to content

Commit

Permalink
clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
dp1 committed Oct 16, 2023
1 parent 6a83fb0 commit 2518d2e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 12 deletions.
5 changes: 1 addition & 4 deletions task-maker-exec/src/check_dag.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,7 @@ pub fn check_dag(dag: &ExecutionDAGData, callbacks: &ExecutionDAGWatchSet) -> Re
let mut ready_files: VecDeque<FileUuid> = VecDeque::new();

let mut add_dependency = |file: FileUuid, group: ExecutionGroupUuid| {
dependencies
.entry(file)
.or_insert_with(Vec::new)
.push(group);
dependencies.entry(file).or_default().push(group);
};

// add the executions and check for duplicated UUIDs
Expand Down
14 changes: 7 additions & 7 deletions task-maker-format/src/ioi/statement/statement.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,22 +136,22 @@ impl Statement {
.config
.time_limit
.map(|x| x.to_string())
.unwrap_or_else(String::new),
.unwrap_or_default(),
memory_limit: self
.config
.memory_limit
.map(|x| x.to_string())
.unwrap_or_else(String::new),
.unwrap_or_default(),
difficulty: self
.config
.difficulty
.map(|x| x.to_string())
.unwrap_or_else(String::new),
.unwrap_or_default(),
syllabus_level: self
.config
.syllabus_level
.map(|x| x.to_string())
.unwrap_or_else(String::new),
.unwrap_or_default(),
content: USE_PACKAGE_REGEX
.replace_all(&self.content, r"% $0")
.to_string(),
Expand Down Expand Up @@ -182,7 +182,7 @@ impl Statement {
let ext = path
.extension()
.map(|s| s.to_string_lossy().to_string())
.unwrap_or_else(String::new);
.unwrap_or_default();
if ext.as_str() == "asy" {
let dest = suffix.with_extension("pdf");
if self.content.contains(dest.to_string_lossy().as_ref()) {
Expand Down Expand Up @@ -249,12 +249,12 @@ impl StatementConfig {
.infile
.as_ref()
.map(|p| p.to_string_lossy().to_string())
.unwrap_or_else(String::new),
.unwrap_or_default(),
outfile: task
.outfile
.as_ref()
.map(|p| p.to_string_lossy().to_string())
.unwrap_or_else(String::new),
.unwrap_or_default(),
time_limit: task.time_limit,
memory_limit: task.memory_limit,
difficulty: task.difficulty,
Expand Down
2 changes: 1 addition & 1 deletion task-maker-store/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ impl std::fmt::Debug for FileStoreKey {

impl PartialOrd for FileStoreKey {
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
PartialOrd::partial_cmp(self.hash.as_bytes(), other.hash.as_bytes())
Some(self.cmp(other))
}
}

Expand Down

0 comments on commit 2518d2e

Please sign in to comment.