Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Difference From orphanage-0.1.0 To orphanage-0.1.1
|
2024-10-28
| ||
| 03:42 | Add object name spec string. check-in: 7716fd0685 user: jan tags: trunk | |
|
2024-10-19
| ||
| 13:53 | Change log. check-in: 3a8934a118 user: jan tags: orphanage-0.1.1, trunk | |
|
2024-10-07
| ||
| 01:18 | Exclude examples from publishing. check-in: d41a277a0d user: jan tags: orphanage-0.1.0, trunk | |
| 01:15 | Release maintenance. check-in: 2fdfd4c082 user: jan tags: trunk | |
Changes to Cargo.toml.
1 2 | 1 2 3 4 5 6 7 8 9 10 | - + | [package] name = "orphanage" |
| ︙ |
Changes to src/path.rs.
1 2 3 4 5 6 7 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 | + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + |
//! Utility functions that extend `std::path`.
//!
//! There's some functionality that overlaps with [`fs`](super::fs), but the
//! main difference is that functions in `fs` assume the file system objects
//! exists, while functions in the `path` submodule (generally) make no such
//! assumptions.
use std::{
fs,
|
| ︙ | |||
76 77 78 79 80 81 82 83 | 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + |
basedir.join(pth)
}
}
inner(basedir, pth.as_ref())
}
/*
/// Expand, perform action on expanded path.
pub fn expand_and<F>(input: impl AsRef<str>, f: F) -> Result<PathBuf, Error>
where
F: FnOnce(&Path) -> Result<(), Error>
{
let expanded = match shellexpand::full(&input) {
Ok(value) => Ok(PathBuf::from(value.into_owned())),
Err(e) => Err(Error::BadFormat(format!("Unable to expand path; {e}")))
}?;
// Call closure to process the expanded path
f(&expanded)?;
Ok(expanded)
}
/// Expand, perform action on expanded path and return canonicalized path.
pub fn expand_canonizalize<F>(
input: impl AsRef<str>,
f: F
) -> Result<PathBuf, Error>
where
F: FnOnce(&Path) -> Result<(), Error>
{
let expanded = expand_and(input, f)?;
// Canonicalize
Ok(fs::canonicalize(&expanded)?)
}
*/
// vim: set ft=rust et sw=2 ts=2 sts=2 cinoptions=2 tw=79 :
|
Changes to www/changelog.md.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | + + + + + + + |
# Change Log
## [Unreleased]
[Details](/vdiff?from=orphanage-0.1.0&to=trunk)
### Added
- Add `path::PathExt`, and implement it for `PathBuf`.
- `PathBuf::expand()` expands a string to a `PathBuf` and returns it.
- `PathBuf::expand_and()` works like `PathBuf::expand()` but it runs a
closure on the expanded pwth before returning it.
- `PathBuf::expand_and_canon()` works like `PathBuf::expand_and()` but it
canonicalizes the path just before returning it.
### Changed
### Removed
---
|
| ︙ |