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

Fix a windows incompatibility in connection.rs libsql-sys. #1808

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

milen-denev
Copy link

image

image

        #[cfg(not(target_os = "windows"))]
        use std::os::unix::ffi::OsStrExt;

        #[cfg(target_os = "windows")]
        use std::os::windows::ffi::OsStrExt;

        #[cfg(not(feature = "rusqlite"))]
        let conn = unsafe {

            #[cfg(target_os = "windows")]
            let path = std::ffi::CString::new(path.as_ref().as_os_str().as_encoded_bytes())
                .map_err(|_| crate::error::Error::Bug("invalid database path"))?;

            #[cfg(not(target_os = "windows"))]
            let path = std::ffi::CString::new(path.as_ref().as_os_str().as_bytes())
                .map_err(|_| crate::error::Error::Bug("invalid database path"))?;

@LucioFranco
Copy link
Contributor

needs rustfmt for CI to pass

@milen-denev
Copy link
Author

needs rustfmt for CI to pass

I am sorry, I am very new to commiting, what should I do? Run rustfmt and re-submit a pull request?

@LucioFranco
Copy link
Contributor

You can run cargo fmt it should do the trick

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.

2 participants