Update documentation and annotations
This commit is contained in:
parent
e412d8b6df
commit
0087dab984
2 changed files with 11 additions and 11 deletions
|
@ -279,4 +279,5 @@
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
- `add_directory_from_path` and `start_file_from_path` are no longer deprecated.
|
- `add_directory_from_path` and `start_file_from_path` are no longer deprecated, and they now normalize `..` as well as
|
||||||
|
`.`.
|
19
src/write.rs
19
src/write.rs
|
@ -932,8 +932,9 @@ impl<W: Write + Seek> ZipWriter<W> {
|
||||||
|
|
||||||
/// Starts a file, taking a Path as argument.
|
/// Starts a file, taking a Path as argument.
|
||||||
///
|
///
|
||||||
/// This function ensures that the '/' path separator is used. It also ignores all non 'Normal'
|
/// This function ensures that the '/' path separator is used and normalizes `.` and `..`. It
|
||||||
/// Components, such as a starting '/' or '..' and '.'.
|
/// ignores any `..` or Windows drive letter that would produce a path outside the ZIP file's
|
||||||
|
/// root.
|
||||||
pub fn start_file_from_path<E: FileOptionExtension, P: AsRef<Path>>(
|
pub fn start_file_from_path<E: FileOptionExtension, P: AsRef<Path>>(
|
||||||
&mut self,
|
&mut self,
|
||||||
path: P,
|
path: P,
|
||||||
|
@ -1056,12 +1057,9 @@ impl<W: Write + Seek> ZipWriter<W> {
|
||||||
|
|
||||||
/// Add a directory entry, taking a Path as argument.
|
/// Add a directory entry, taking a Path as argument.
|
||||||
///
|
///
|
||||||
/// This function ensures that the '/' path separator is used. It also ignores all non 'Normal'
|
/// This function ensures that the '/' path separator is used and normalizes `.` and `..`. It
|
||||||
/// Components, such as a starting '/' or '..' and '.'.
|
/// ignores any `..` or Windows drive letter that would produce a path outside the ZIP file's
|
||||||
#[deprecated(
|
/// root.
|
||||||
since = "0.5.7",
|
|
||||||
note = "by stripping `..`s from the path, the meaning of paths can change. Use `add_directory` instead."
|
|
||||||
)]
|
|
||||||
pub fn add_directory_from_path<T: FileOptionExtension, P: AsRef<Path>>(
|
pub fn add_directory_from_path<T: FileOptionExtension, P: AsRef<Path>>(
|
||||||
&mut self,
|
&mut self,
|
||||||
path: P,
|
path: P,
|
||||||
|
@ -1123,8 +1121,9 @@ impl<W: Write + Seek> ZipWriter<W> {
|
||||||
|
|
||||||
/// Add a symlink entry, taking Paths to the location and target as arguments.
|
/// Add a symlink entry, taking Paths to the location and target as arguments.
|
||||||
///
|
///
|
||||||
/// This function ensures that the '/' path separator is used. It also ignores all non 'Normal'
|
/// This function ensures that the '/' path separator is used and normalizes `.` and `..`. It
|
||||||
/// Components, such as a starting '/' or '..' and '.'.
|
/// ignores any `..` or Windows drive letter that would produce a path outside the ZIP file's
|
||||||
|
/// root.
|
||||||
pub fn add_symlink_from_path<P: AsRef<Path>, T: AsRef<Path>, E: FileOptionExtension>(
|
pub fn add_symlink_from_path<P: AsRef<Path>, T: AsRef<Path>, E: FileOptionExtension>(
|
||||||
&mut self,
|
&mut self,
|
||||||
path: P,
|
path: P,
|
||||||
|
|
Loading…
Add table
Reference in a new issue