Skip to content
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

Merged
merged 4 commits into from
Sep 13, 2024
Merged

feat: resolve ~ paths #875

merged 4 commits into from
Sep 13, 2024

Conversation

simbleau
Copy link
Member

@simbleau simbleau commented Sep 13, 2024

Closes #872

@simbleau simbleau requested a review from ctron September 13, 2024 11:24
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"
Copy link
Member Author

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.

Copy link
Collaborator

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@ctron
Copy link
Collaborator

ctron commented Sep 13, 2024

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 😉

@@ -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('~') {
Copy link
Collaborator

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.

@ctron
Copy link
Collaborator

ctron commented Sep 13, 2024

Looks quick and simple. Love it.

@simbleau simbleau requested a review from ctron September 13, 2024 13:23
@simbleau simbleau merged commit 2352cde into main Sep 13, 2024
60 checks passed
@simbleau simbleau deleted the simbleau/issue-872 branch September 13, 2024 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Canonical path to TLS key/pem
2 participants