mirror of https://github.com/rwf2/Rocket.git
Fix 'Segments::to_path_buf()' on Windows.
This commit is contained in:
parent
82cd53de36
commit
2a7eac01bb
|
@ -215,12 +215,10 @@ impl<'a> Segments<'a, Path> {
|
||||||
return Err(PathError::BadEnd('<'))
|
return Err(PathError::BadEnd('<'))
|
||||||
} else if segment.contains('/') {
|
} else if segment.contains('/') {
|
||||||
return Err(PathError::BadChar('/'))
|
return Err(PathError::BadChar('/'))
|
||||||
} else if cfg!(windows) {
|
} else if cfg!(windows) && segment.contains('\\') {
|
||||||
if segment.contains('\\') {
|
return Err(PathError::BadChar('\\'))
|
||||||
return Err(PathError::BadChar('\\'))
|
} else if cfg!(windows) && segment.contains(':') {
|
||||||
} else if segment.contains(':') {
|
return Err(PathError::BadChar(':'))
|
||||||
return Err(PathError::BadChar(':'))
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
buf.push(&*segment)
|
buf.push(&*segment)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue