Commit Graph

198 Commits

Author SHA1 Message Date
king6cong
e66388d21f doc rewording 2017-05-26 19:22:25 +08:00
Oliver Schneider
dd87eabd83 Remove need for &format!(...) or &&"" dances in span_label calls 2017-05-08 12:56:15 +02:00
Oliver Middleton
b4be475836 Fix Markdown issues in the docs
* Since the switch to pulldown-cmark reference links need a blank line
before the URLs.
* Reference link references are not case sensitive.
* Doc comments need to be indented uniformly otherwise rustdoc gets
confused.
2017-04-06 12:57:40 +01:00
Peter Gerber
ff4febf8ea Improve documentation for std::fs::DirBuilder 2017-04-02 04:06:29 +02:00
Dawid Ciężarkiewicz
088696b98f Fix problems left in concurrent_recursive_mkdir
Increase lifetime of `tmpdir`, and really change the length of test
path.
2017-03-18 21:03:51 -07:00
Dawid Ciężarkiewicz
b5d590b3f0 Fix create_dir_all("")
Add a test for `""` and `"."`.
2017-03-17 20:15:05 -07:00
Dawid Ciężarkiewicz
bcae6a3734 Reorder match checks in create_dir_all
Avoid doing `is_dir` in the fast path.
2017-03-17 20:15:05 -07:00
Dawid Ciężarkiewicz
c3e2eaf4cb Fix problems found on Windows in dir_create_all
Ignore the type of error altogether. The rationale is: it doesn't matter
what was the problem if the directory is there. In the previous versions
if the directory was there already we wouldn't even attempt to create
it, so we wouldn't know about the problem neither.

Make test path length smaller in `concurrent_recursive_mkdir` test.
2017-03-17 20:15:05 -07:00
Dawid Ciężarkiewicz
a51c6aaf84 Break line longer than 100 characters 2017-03-17 20:15:05 -07:00
Dawid Ciężarkiewicz
f2adee74a3 Add concurrent_recursive_mkdir test 2017-03-17 20:15:05 -07:00
Dawid Ciężarkiewicz
0ec28b796d Fix new version of create_dir_all
It will now correctly fail on existing non-directories.
2017-03-17 20:15:05 -07:00
David Roundy
db00ba9eb2 Fix race condition in fs::create_dir_all
It is more robust to not fail if any directory in a path was created
concurrently. This change lifts rustc internal `create_dir_racy` that
was created to handle such conditions to be new `create_dir_all`
implementation.
2017-03-17 20:15:05 -07:00
Corey Farwell
e7b0f2badf Remove function invokation parens from documentation links.
This was never established as a convention we should follow in the 'More
API Documentation Conventions' RFC:

https://github.com/rust-lang/rfcs/blob/master/text/1574-more-api-documentation-conventions.md
2017-03-13 21:43:18 -04:00
Oliver Middleton
9128f6100c Fix a few impl stability attributes
The versions show up in rustdoc.
2017-01-29 13:31:47 +00:00
Alex Crichton
671b1c1d89 std: Stabilize APIs for the 1.16.0 release
This commit applies the stabilization/deprecations of the 1.16.0 release, as
tracked by the rust-lang/rust issue tracker and the final-comment-period tag.

The following APIs were stabilized:

* `VecDeque::truncate`
* `VecDeque::resize`
* `String::insert_str`
* `Duration::checked_{add,sub,div,mul}`
* `str::replacen`
* `SocketAddr::is_ipv{4,6}`
* `IpAddr::is_ipv{4,6}`
* `str::repeat`
* `Vec::dedup_by`
* `Vec::dedup_by_key`
* `Result::unwrap_or_default`
* `<*const T>::wrapping_offset`
* `<*mut T>::wrapping_offset`
* `CommandExt::creation_flags` (on Windows)
* `File::set_permissions`
* `String::split_off`

The following APIs were deprecated

* `EnumSet` - replaced with other ecosystem abstractions, long since unstable

Closes #27788
Closes #35553
Closes #35774
Closes #36436
Closes #36949
Closes #37079
Closes #37087
Closes #37516
Closes #37827
Closes #37916
Closes #37966
Closes #38080
2017-01-25 16:43:01 -08:00
Utkarsh Kukreti
9d912b683a libstd: replace all try! with ? in documentation examples
See #38644.
2017-01-22 21:07:38 +05:30
bors
1b06375034 Auto merge of #39176 - CartesianDaemon:master, r=frewsxcv
Use fs::symlink_metadata in doc for is_symlink

fs::metadata() follows symlinks so is_symlink() will always return
false. Use symlink_metadata instead in the example in the
documentation.

See issue #39088.
2017-01-22 01:19:18 +00:00
Jack Vickeridge
f55bbaa634 Revert "Add link to symlink_metadata in fs::Metadata doc"
This reverts commit fe9f5d52a6.
2017-01-21 19:57:57 +00:00
Andrea Canciani
780371107d Document that Metadata can be obtained from symlink_metadata 2017-01-20 09:31:06 +01:00
Jack Vickeridge
fe9f5d52a6 Add link to symlink_metadata in fs::Metadata doc 2017-01-20 00:38:52 +00:00
Jack Vickeridge
e8f2e2b521 Fix formatting and links in previous doc change. 2017-01-20 00:38:46 +00:00
Jack Vickeridge
ea70a88710 Use fs::symlink_metadata in doc for is_symlink
fs::metadata() follows symlinks so is_symlink() will always return
false. Use symlink_metadata instead in the example in the
documentation.

See issue #39088.
2017-01-19 09:30:58 +00:00
Chris Morgan
58aac456ae Fix a couple of bad Markdown links 2017-01-09 13:39:09 +05:30
bors
8493dbed6c Auto merge of #38536 - retep998:flauschige-kaninchen, r=petrochenkov
Fix fs tests on Windows systems with non-english locales.

Fixes https://github.com/rust-lang/rust/issues/34628

r? @alexcrichton
2016-12-26 10:52:56 +00:00
bors
00e61d4185 Auto merge of #38443 - frewsxcv:file-docs, r=brson
Improve the API examples for `std::fs::File`.

Fixes https://github.com/rust-lang/rust/issues/35875.
2016-12-24 18:00:45 +00:00
Peter Atashian
23cfcddd77
Fix fs tests on Windows systems with non-english locales. 2016-12-22 06:43:43 -05:00
Corey Farwell
86fc63e62d Implement fmt::Debug for all structures in libstd.
Part of https://github.com/rust-lang/rust/issues/31869.

Also turn on the `missing_debug_implementations` lint at the crate
level.
2016-12-18 14:55:14 -08:00
Corey Farwell
a664466405 Improve the API examples for std::fs::File.
* Separate functionality into different code blocks
* Incorporate `BufReader` example
 * Fixes https://github.com/rust-lang/rust/issues/35875.
2016-12-18 01:27:47 -08:00
Steven Allen
1aaca5f290 Add a method for setting permissions directly on an open file.
On unix like systems, the underlying file corresponding to any given path may
change at any time. This function makes it possible to set the permissions of
the a file corresponding to a `File` object even if its path changes.
2016-11-22 08:42:28 -08:00
David Henningsson
e4ed345b2c impl Debug for ReadDir
It is good practice to implement Debug for public types, and
indicating what directory you're reading seems useful.

Signed-off-by: David Henningsson <diwic@ubuntu.com>
2016-10-16 20:42:55 +02:00
Tobias Bucher
b3f2644b66 Implement reading and writing atomically at certain offsets
These functions allow to read from and write to a file in one atomic
action from multiple threads, avoiding the race between the seek and the
read.

The functions are named `{read,write}_at` on non-Windows (which don't
change the file cursor), and `seek_{read,write}` on Windows (which
change the file cursor).
2016-10-09 10:48:07 +02:00
Brian Anderson
096670ca41 Ignore various entire test modules on emscripten 2016-09-30 14:02:56 -07:00
Brian Anderson
9c4a01ee9e Ignore lots and lots of std tests on emscripten 2016-09-30 14:02:48 -07:00
Corey Farwell
6b697a375e Implement Debug for DirEntry. 2016-09-22 14:08:03 -04:00
Jonathan Turner
4bc5bcd812 Rollup merge of #35786 - GuillaumeGomez:paths_doc, r=steveklabnik
Improve Path and PathBuf docs

r? @steveklabnik
2016-08-31 13:53:33 -07:00
Guillaume Gomez
96e3103cfe Improve Path and PathBuf docs 2016-08-31 17:53:01 +02:00
Jeffrey Seyfried
9a2c8783d9 Use #[prelude_import] in libstd. 2016-08-24 22:12:48 +00:00
Guillaume Gomez
56a89f5314 Rollup merge of #35076 - GuillaumeGomez:file_type_docs, r=steveklabnik
Add doc examples for FileType struct

Part of #29356.

r? @steveklabnik
2016-08-05 16:12:53 +02:00
Guillaume Gomez
3e46c9dfcc Add doc examples for FileType struct 2016-08-03 12:52:36 +02:00
Guillaume Gomez
52c50ba276 Add doc examples for std::fs::Metadata 2016-07-28 02:53:34 +02:00
Steve Klabnik
8de36f1423 Rollup merge of #35010 - GuillaumeGomez:file_doc, r=steveklabnik
Improve Open doc

Part of #29356.

r? @steveklabnik
2016-07-26 17:21:13 -04:00
Steve Klabnik
57d50299a7 Rollup merge of #35009 - GuillaumeGomez:dir_entry_doc, r=steveklabnik
Dir entry doc

Part of #29356.

r? @steveklabnik
2016-07-26 17:21:13 -04:00
Guillaume Gomez
debb2ac76b Improve Open doc 2016-07-24 17:00:49 +02:00
Guillaume Gomez
16699635bc Add DirEntry doc examples 2016-07-24 16:52:28 +02:00
Guillaume Gomez
dad29a6d03 Add missing links 2016-07-24 16:07:06 +02:00
Guillaume Gomez
90bb8d469c Add DirBuilder doc examples 2016-07-23 01:57:21 +02:00
Mark Buer
d820fcba12 Remove rustdoc reference to walk_dir 2016-07-18 17:54:15 +09:30
Martin Pool
bba33ecd86 Derive Debug on FileType.
Partially fixes #32054
2016-07-10 15:37:41 -07:00
Gleb Kozyrev
552afd30d0 Fix a docs typo 2016-06-15 13:06:48 +03:00
Gleb Kozyrev
1db97575cc Test ErrorKind::AlreadyExists for files 2016-06-15 13:05:43 +03:00