File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -190,8 +190,8 @@ impl Tzif {
190
190
#[ cfg( target_family = "unix" ) ]
191
191
pub fn read_tzif ( identifier : & str ) -> TemporalResult < Self > {
192
192
// 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" ) ) ;
195
195
}
196
196
let mut path = PathBuf :: from ( ZONEINFO_DIR ) ;
197
197
path. push ( identifier) ;
@@ -200,7 +200,7 @@ impl Tzif {
200
200
201
201
pub fn from_path ( path : & Path ) -> TemporalResult < Self > {
202
202
if !path. exists ( ) {
203
- return Err ( TemporalError :: range ( "Unknown timezone identifier" ) ) ;
203
+ return Err ( TemporalError :: range ( ) . with_message ( "Unknown timezone identifier" ) ) ;
204
204
}
205
205
tzif:: parse_tzif_file ( path)
206
206
. map ( Into :: into)
You can’t perform that action at this time.
0 commit comments