Skip to content

Commit

Permalink
fix: clippy errors
Browse files Browse the repository at this point in the history
  • Loading branch information
bconn98 committed Dec 6, 2023
1 parent e492124 commit b39f166
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/encode/pattern/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ impl<'a> From<Piece<'a>> for Chunk {
return Chunk::Error("expected at most two arguments".to_owned());
}

let format = match formatter.args.get(0) {
let format = match formatter.args.first() {
Some(arg) => {
let mut format = String::new();
for piece in arg {
Expand All @@ -411,7 +411,7 @@ impl<'a> From<Piece<'a>> for Chunk {

let timezone = match formatter.args.get(1) {
Some(arg) => {
if let Some(arg) = arg.get(0) {
if let Some(arg) = arg.first() {
match *arg {
Piece::Text("utc") => Timezone::Utc,
Piece::Text("local") => Timezone::Local,
Expand Down Expand Up @@ -465,9 +465,9 @@ impl<'a> From<Piece<'a>> for Chunk {
return Chunk::Error("expected at most two arguments".to_owned());
}

let key = match formatter.args.get(0) {
let key = match formatter.args.first() {
Some(arg) => {
if let Some(arg) = arg.get(0) {
if let Some(arg) = arg.first() {
match arg {
Piece::Text(key) => key.to_owned(),
Piece::Error(ref e) => return Chunk::Error(e.clone()),
Expand All @@ -482,7 +482,7 @@ impl<'a> From<Piece<'a>> for Chunk {

let default = match formatter.args.get(1) {
Some(arg) => {
if let Some(arg) = arg.get(0) {
if let Some(arg) = arg.first() {
match arg {
Piece::Text(key) => key.to_owned(),
Piece::Error(ref e) => return Chunk::Error(e.clone()),
Expand Down

0 comments on commit b39f166

Please sign in to comment.