Skip to content

The first function should probably be generic over the path type, and the second becomes obsolete. #155

@JohnPeel

Description

@JohnPeel

https://github.com/solsticegamestudios/GModCEFCodecFix/blob/d45a8690f9dff2e7097cf1dceb71815ace6cbab4/src/main.rs#L123-L153

fn path_to_canonical_pathbuf(path: impl AsRef<Path>, checkdirempty: bool) -> io::Result<PathBuf> {
	let pathbuf = path.as_ref().canonicalize()?;
	if checkdirempty && pathbuf_dir_not_empty(&pathbuf) {
		return Err(io::Error::other("directory not empty"));
	}
	Ok(pathbuf)
}

String and str implement AsRef<Path>, so this function would work for that case as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions