Skip to content

Commit e95ce82

Browse files
committed
lint
1 parent 5eaba81 commit e95ce82

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/tzdb.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,8 @@ impl Tzif {
190190
#[cfg(target_family = "unix")]
191191
pub fn read_tzif(identifier: &str) -> TemporalResult<Self> {
192192
// Protect from path traversal attacks
193-
if (identifier.starts_with('/') || identifier.contains('.')) {
194-
return Err(TemporalError::range("Ill-formed timezone identifier"));
193+
if identifier.starts_with('/') || identifier.contains('.') {
194+
return Err(TemporalError::range().with_message("Ill-formed timezone identifier"));
195195
}
196196
let mut path = PathBuf::from(ZONEINFO_DIR);
197197
path.push(identifier);
@@ -200,7 +200,7 @@ impl Tzif {
200200

201201
pub fn from_path(path: &Path) -> TemporalResult<Self> {
202202
if !path.exists() {
203-
return Err(TemporalError::range("Unknown timezone identifier"));
203+
return Err(TemporalError::range().with_message("Unknown timezone identifier"));
204204
}
205205
tzif::parse_tzif_file(path)
206206
.map(Into::into)

0 commit comments

Comments
 (0)