awslabs / tough

Rust libraries and tools for using and generating TUF repositories
191 stars 45 forks source link

Fix up path prefix check for windows #656

Closed jon-zu closed 11 months ago

jon-zu commented 11 months ago

Issue #, if available:

347 (somewhat, I think)

Description of changes:

When loading a repository, the absolutized path will start with \ instead of /, so I changed It to use std::path::MAIN_SEPARATOR_STR. This allows me to use the Repository struct on Windows properly.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

cbgbt commented 11 months ago

I guess cargo fmt check doesn't like the blank space at the end of the line. Happy to update the PR or let you do it!