Skip to content

Commit

Permalink
Cleanup cf::Url a little bit
Browse files Browse the repository at this point in the history
  • Loading branch information
yury committed Nov 7, 2024
1 parent bb09087 commit 1e008be
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions cidre/src/cf/url.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,17 +61,7 @@ impl Url {

#[inline]
pub fn with_path(path: &Path, is_dir: bool) -> Option<arc::R<Url>> {
let bytes = path.to_str()?.as_bytes();
let encoding = cf::StringEncoding::UTF8;
let Some(path) = cf::String::create_with_bytes_no_copy_in(
bytes,
encoding,
false,
cf::Allocator::null(),
None,
) else {
return None;
};
let path = unsafe { cf::String::from_str_no_copy(path.to_str()?) };
cf::Url::with_fs_path_in(&path, PathStyle::Posix, is_dir, None)
}

Expand Down

0 comments on commit 1e008be

Please sign in to comment.