File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -167,6 +167,16 @@ unsafe fn get_unchecked(&self, index: K) -> &V;
167
167
unsafe fn get_unchecked_mut (& mut self , index : K ) -> & mut V ;
168
168
```
169
169
170
+ The difference between getters and conversions ([ C-CONV] ( #c-conv ) ) can be subtle
171
+ and is not always clear-cut. For example [ ` TempDir::path ` ] can be understood as
172
+ a getter for the filesystem path of the temporary directory, while
173
+ [ ` TempDir::into_path ` ] is a conversion that transfers responsibility for
174
+ deleting the temporary directory to the caller. Since ` path ` is a getter, it
175
+ would not be correct to call it ` get_path ` or ` as_path ` .
176
+
177
+ [ `TempDir::path` ] : https://docs.rs/tempdir/0.3.5/tempdir/struct.TempDir.html#method.path
178
+ [ `TempDir::into_path` ] : https://docs.rs/tempdir/0.3.5/tempdir/struct.TempDir.html#method.into_path
179
+
170
180
### Examples from the standard library
171
181
172
182
- [ ` std::io::Cursor::get_mut ` ] ( https://doc.rust-lang.org/std/io/struct.Cursor.html#method.get_mut )
You can’t perform that action at this time.
0 commit comments