File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -124,6 +124,26 @@ impl Path {
124
124
self . inner . display ( )
125
125
}
126
126
127
+ /// Determines whether `child` is a suffix of `self`.
128
+ ///
129
+ /// Only considers whole path components to match.
130
+ ///
131
+ /// # Examples
132
+ ///
133
+ /// ```
134
+ /// use async_std::path::Path;
135
+ ///
136
+ /// let path = Path::new("/etc/passwd");
137
+ ///
138
+ /// assert!(path.ends_with("passwd"));
139
+ /// ```
140
+ pub fn ends_with < P : AsRef < Path > > ( & self , child : P ) -> bool
141
+ where
142
+ P : std:: convert:: AsRef < std:: path:: Path > ,
143
+ {
144
+ self . inner . ends_with ( child)
145
+ }
146
+
127
147
/// Returns `true` if the path points at an existing entity.
128
148
///
129
149
/// This function will traverse symbolic links to query information about the
You can’t perform that action at this time.
0 commit comments