From 8bf77fa786aae4993fa923f0826529bfb9ce1166 Mon Sep 17 00:00:00 2001 From: Barosl Lee Date: Wed, 12 Nov 2014 03:36:09 +0900 Subject: Fix remaining documentation to reflect fail!() -> panic!() Throughout the docs, "failure" was replaced with "panics" if it means a task panic. Otherwise, it remained as is, or changed to "errors" to clearly differentiate it from a task panic. --- src/libstd/path/mod.rs | 28 ++++++++++++++-------------- src/libstd/path/posix.rs | 4 ++-- src/libstd/path/windows.rs | 12 ++++++------ 3 files changed, 22 insertions(+), 22 deletions(-) (limited to 'src/libstd/path') diff --git a/src/libstd/path/mod.rs b/src/libstd/path/mod.rs index e55933c4262..a185a29a700 100644 --- a/src/libstd/path/mod.rs +++ b/src/libstd/path/mod.rs @@ -154,9 +154,9 @@ pub trait GenericPath: Clone + GenericPathUnsafe { /// # } /// ``` /// - /// # Failure + /// # Panics /// - /// Fails the task if the path contains a NUL. + /// Panics the task if the path contains a NUL. /// /// See individual Path impls for additional restrictions. #[inline] @@ -443,9 +443,9 @@ pub trait GenericPath: Clone + GenericPathUnsafe { /// # } /// ``` /// - /// # Failure + /// # Panics /// - /// Fails the task if the filename contains a NUL. + /// Panics the task if the filename contains a NUL. #[inline] fn set_filename(&mut self, filename: T) { assert!(!contains_nul(&filename)); @@ -469,9 +469,9 @@ pub trait GenericPath: Clone + GenericPathUnsafe { /// # } /// ``` /// - /// # Failure + /// # Panics /// - /// Fails the task if the extension contains a NUL. + /// Panics the task if the extension contains a NUL. fn set_extension(&mut self, extension: T) { assert!(!contains_nul(&extension)); @@ -518,9 +518,9 @@ pub trait GenericPath: Clone + GenericPathUnsafe { /// # } /// ``` /// - /// # Failure + /// # Panics /// - /// Fails the task if the filename contains a NUL. + /// Panics the task if the filename contains a NUL. #[inline] fn with_filename(&self, filename: T) -> Self { let mut p = self.clone(); @@ -543,9 +543,9 @@ pub trait GenericPath: Clone + GenericPathUnsafe { /// # } /// ``` /// - /// # Failure + /// # Panics /// - /// Fails the task if the extension contains a NUL. + /// Panics the task if the extension contains a NUL. #[inline] fn with_extension(&self, extension: T) -> Self { let mut p = self.clone(); @@ -602,9 +602,9 @@ pub trait GenericPath: Clone + GenericPathUnsafe { /// # } /// ``` /// - /// # Failure + /// # Panics /// - /// Fails the task if the path contains a NUL. + /// Panics the task if the path contains a NUL. #[inline] fn push(&mut self, path: T) { assert!(!contains_nul(&path)); @@ -671,9 +671,9 @@ pub trait GenericPath: Clone + GenericPathUnsafe { /// # } /// ``` /// - /// # Failure + /// # Panics /// - /// Fails the task if the path contains a NUL. + /// Panics the task if the path contains a NUL. #[inline] fn join(&self, path: T) -> Self { let mut p = self.clone(); diff --git a/src/libstd/path/posix.rs b/src/libstd/path/posix.rs index 9918e939097..794f6978642 100644 --- a/src/libstd/path/posix.rs +++ b/src/libstd/path/posix.rs @@ -327,9 +327,9 @@ impl GenericPath for Path { impl Path { /// Returns a new Path from a byte vector or string /// - /// # Failure + /// # Panics /// - /// Fails the task if the vector contains a NUL. + /// Panics the task if the vector contains a NUL. #[inline] pub fn new(path: T) -> Path { GenericPath::new(path) diff --git a/src/libstd/path/windows.rs b/src/libstd/path/windows.rs index 3a5350f0a29..2da2159653e 100644 --- a/src/libstd/path/windows.rs +++ b/src/libstd/path/windows.rs @@ -159,9 +159,9 @@ impl BytesContainer for Path { impl GenericPathUnsafe for Path { /// See `GenericPathUnsafe::from_vec_unchecked`. /// - /// # Failure + /// # Panics /// - /// Fails if not valid UTF-8. + /// Panics if not valid UTF-8. #[inline] unsafe fn new_unchecked(path: T) -> Path { let (prefix, path) = Path::normalize_(path.container_as_str().unwrap()); @@ -173,9 +173,9 @@ impl GenericPathUnsafe for Path { /// See `GenericPathUnsafe::set_filename_unchecked`. /// - /// # Failure + /// # Panics /// - /// Fails if not valid UTF-8. + /// Panics if not valid UTF-8. unsafe fn set_filename_unchecked(&mut self, filename: T) { let filename = filename.container_as_str().unwrap(); match self.sepidx_or_prefix_len() { @@ -600,9 +600,9 @@ impl GenericPath for Path { impl Path { /// Returns a new `Path` from a `BytesContainer`. /// - /// # Failure + /// # Panics /// - /// Fails if the vector contains a `NUL`, or if it contains invalid UTF-8. + /// Panics if the vector contains a `NUL`, or if it contains invalid UTF-8. /// /// # Example /// -- cgit 1.4.1-3-g733a5