D1581: [RFC] rust: Rust implementation of `hg` and standalone packaging

yuja (Yuya Nishihara) phabricator at mercurial-scm.org
Tue Dec 5 09:40:27 EST 2017


yuja added inline comments.

INLINE COMMENTS

> main.rs:101
> +fn set_python_home(env: &Environment) {
> +    let raw = CString::new(env.python_home.to_str().unwrap())
> +        .unwrap()

Perhaps we'll need a utility function for platform-specific cstr
conversion.

On Unix, the story is simple. We can use OsStrExt. On Windows, 
maybe we'll have to first convert it to "wide characters" by OsStrExt
and then call `WideCharToMultiByte` to convert it back to ANSI bytes sequence.

I have no idea if Rust stdlib provides a proper way to convert
OsStr to Windows ANSI bytes.

https://stackoverflow.com/a/38948854
https://msdn.microsoft.com/en-us/library/windows/desktop/dd374130(v=vs.85).aspx

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D1581

To: indygreg, #hg-reviewers
Cc: yuja, quark, durin42, dlax, mercurial-devel


More information about the Mercurial-devel mailing list