mirror of
https://github.com/rust-lang/cargo.git
synced 2025-09-25 11:14:46 +00:00
cargo-credential-libsecret: don't allocate "url" C string
We already don't do this and use this precise idiom elsewhere
This commit is contained in:
parent
1abdb1d2aa
commit
67749b1a30
@ -168,7 +168,7 @@ mod linux {
|
|||||||
|
|
||||||
let index_url_c = CString::new(registry.index_url).unwrap();
|
let index_url_c = CString::new(registry.index_url).unwrap();
|
||||||
let mut error: *mut GError = null_mut();
|
let mut error: *mut GError = null_mut();
|
||||||
let attr_url = CString::new("url").unwrap();
|
let attr_url = b"url\0".as_ptr() as *const gchar;
|
||||||
let schema = schema();
|
let schema = schema();
|
||||||
match action {
|
match action {
|
||||||
cargo_credential::Action::Get(_) => {
|
cargo_credential::Action::Get(_) => {
|
||||||
@ -177,7 +177,7 @@ mod linux {
|
|||||||
&schema,
|
&schema,
|
||||||
null_mut(),
|
null_mut(),
|
||||||
&mut error,
|
&mut error,
|
||||||
attr_url.as_ptr(),
|
attr_url,
|
||||||
index_url_c.as_ptr(),
|
index_url_c.as_ptr(),
|
||||||
null() as *const gchar,
|
null() as *const gchar,
|
||||||
);
|
);
|
||||||
@ -217,7 +217,7 @@ mod linux {
|
|||||||
token.as_ptr(),
|
token.as_ptr(),
|
||||||
null_mut(),
|
null_mut(),
|
||||||
&mut error,
|
&mut error,
|
||||||
attr_url.as_ptr(),
|
attr_url,
|
||||||
index_url_c.as_ptr(),
|
index_url_c.as_ptr(),
|
||||||
null() as *const gchar,
|
null() as *const gchar,
|
||||||
);
|
);
|
||||||
@ -239,7 +239,7 @@ mod linux {
|
|||||||
&schema,
|
&schema,
|
||||||
null_mut(),
|
null_mut(),
|
||||||
&mut error,
|
&mut error,
|
||||||
attr_url.as_ptr(),
|
attr_url,
|
||||||
index_url_c.as_ptr(),
|
index_url_c.as_ptr(),
|
||||||
null() as *const gchar,
|
null() as *const gchar,
|
||||||
);
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user