-
Notifications
You must be signed in to change notification settings - Fork 268
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: resolve ~
paths
#875
Conversation
Cargo.toml
Outdated
tokio-tungstenite = "0.23" | ||
toml = "0.8" | ||
tower-http = { version = "0.5.1", features = ["fs", "trace", "set-header"] } | ||
tracing = "0.1" | ||
tracing-subscriber = { version = "0.3", features = ["env-filter"] } | ||
which = "6" | ||
zip = "2" | ||
homedir = "0.3.3" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was the only real change on this page, the rest was rustfmt
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you sort that alphabetically.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
I'd prefer to keep the dependencies as one liners, and sort them alphabetically. Which Rust Rover can easily do, if dependencies are one liners 😉 |
src/config/rt/serve.rs
Outdated
@@ -250,7 +250,21 @@ fn absolute_path_if_some( | |||
file_description: &str, | |||
) -> anyhow::Result<Option<PathBuf>, anyhow::Error> { | |||
match maybe_path { | |||
Some(path) => Ok(Some(absolute_path(path, file_description)?)), | |||
Some(path) => { | |||
let path = if path.display().to_string().contains('~') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can go with to_string_lossy
, which should prevent allocation and might be a bit shorter.
Looks quick and simple. Love it. |
Closes #872