Skip to content

Commit

Permalink
Clippy updates
Browse files Browse the repository at this point in the history
  • Loading branch information
DoggySazHi committed Nov 10, 2023
1 parent 287663a commit 6100144
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/commands/ucm/calendar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ fn process_calendar(data: &str) -> Option<AcademicCalendar> {
.map(|col| col.text().next().map(|o| o.to_string()).unwrap_or_else(|| "<unknown>".to_string()))
.collect::<Vec<_>>();

(items.get(0).map(|o| o.to_string()).unwrap_or_else(|| "<unknown>".to_string()),
(items.first().map(|o| o.to_string()).unwrap_or_else(|| "<unknown>".to_string()),
items.get(1).map(|o| o.to_string()).unwrap_or_else(|| "<unknown>".to_string()))
})
.collect::<Vec<_>>()
Expand Down
2 changes: 1 addition & 1 deletion src/commands/ucm/foodtrucks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ fn process_schedules(data: &str) -> Option<String> {
});

if day.is_some() {
return day.map(|o| o.to_string());
day.map(|o| o.to_string())
} else {
None
}
Expand Down
2 changes: 1 addition & 1 deletion src/commands/ucm/professors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ async fn print_matches(ctx: &CowContext<'_>, professors: &[Professor]) -> Result
if professors.is_empty() {
ctx.say("No matches were found. Check your query for typos or generalize it. Or, we may not have the person logged.").await?;
} else if professors.len() == 1 {
professor_embed(ctx, professors.get(0).unwrap()).await?;
professor_embed(ctx, professors.first().unwrap()).await?;
} else {
ctx.send(|m| m.embed(|e| {
e.title("Professor Search").description("Multiple results were found for your query. Try refining your input.");
Expand Down
4 changes: 2 additions & 2 deletions src/services/database.rs
Original file line number Diff line number Diff line change
Expand Up @@ -229,9 +229,9 @@ impl Database {
.into_results()
.await?;

let count: i32 = res.get(1).unwrap().get(0).unwrap().get(0).unwrap();
let count: i32 = res.get(1).unwrap().first().unwrap().get(0).unwrap();

let members = res.get(0).unwrap().iter()
let members = res.first().unwrap().iter()
.map(|row| {
let id: rust_decimal::Decimal = row.get(0).unwrap();
Member {
Expand Down

0 comments on commit 6100144

Please sign in to comment.