Skip to content

Commit a102347

Browse files
style(api): Import types instead of using inline paths
Add proper imports for StdDuration and SerError to improve readability instead of using std::time::Duration and serde::ser::Error inline. Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 2ce704e commit a102347

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

src/api/mod.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ use std::fs::File;
2020
use std::io::{self, Read as _, Write};
2121
use std::rc::Rc;
2222
use std::sync::Arc;
23+
use std::time::Duration as StdDuration;
2324
use std::{fmt, thread};
2425

2526
use anyhow::{Context as _, Result};
@@ -36,6 +37,7 @@ use parking_lot::Mutex;
3637
use regex::{Captures, Regex};
3738
use secrecy::ExposeSecret as _;
3839
use serde::de::DeserializeOwned;
40+
use serde::ser::Error as SerError;
3941
use serde::{Deserialize, Serialize, Serializer};
4042
use sha1_smol::Digest;
4143
use symbolic::common::DebugId;
@@ -71,7 +73,7 @@ const RETRY_STATUS_CODES: &[u32] = &[
7173
];
7274

7375
/// Timeout for the review API request (10 minutes)
74-
const REVIEW_TIMEOUT: std::time::Duration = std::time::Duration::from_secs(600);
76+
const REVIEW_TIMEOUT: StdDuration = StdDuration::from_secs(600);
7577

7678
/// Serializes git2::Oid as a hex string.
7779
fn serialize_oid<S>(oid: &Oid, serializer: S) -> Result<S::Ok, S::Error>
@@ -93,9 +95,9 @@ where
9395
}
9496
true
9597
})
96-
.map_err(serde::ser::Error::custom)?;
98+
.map_err(SerError::custom)?;
9799

98-
let diff_str = String::from_utf8(output).map_err(serde::ser::Error::custom)?;
100+
let diff_str = String::from_utf8(output).map_err(SerError::custom)?;
99101
serializer.serialize_str(&diff_str)
100102
}
101103

0 commit comments

Comments
 (0)