Bug 1896171 - Follow-up: Fix use of C-strings in Rust. r=ikey DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D216006 --HG-- extra : rebase_source : 176bc688f1485eca4a018783d11fbf52b996f2c9 extra : amend_source : e868765bc41fdf1c6567bbfcba77d4f4fa14f506
This commit is contained in:
Родитель
1f2be55003
Коммит
c470186cf0
|
@ -54,16 +54,15 @@ enum PrefName {
|
|||
|
||||
impl From<PrefName> for CString {
|
||||
fn from(value: PrefName) -> Self {
|
||||
let value = match value {
|
||||
PrefName::Key => "key",
|
||||
PrefName::Uid => "uid",
|
||||
PrefName::Description => "description",
|
||||
PrefName::Username => "username",
|
||||
PrefName::AuthMethod => "auth_method",
|
||||
PrefName::EwsUrl => "ews_url",
|
||||
};
|
||||
|
||||
cstr!(value).into()
|
||||
match value {
|
||||
PrefName::Key => cstr!("key"),
|
||||
PrefName::Uid => cstr!("uid"),
|
||||
PrefName::Description => cstr!("description"),
|
||||
PrefName::Username => cstr!("username"),
|
||||
PrefName::AuthMethod => cstr!("auth_method"),
|
||||
PrefName::EwsUrl => cstr!("ews_url"),
|
||||
}
|
||||
.into()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -675,7 +674,7 @@ impl AuthenticationProvider for &EwsOutgoingServer {
|
|||
|
||||
fn oauth2_module(&self) -> Result<Option<RefPtr<msgIOAuth2Module>>, nsresult> {
|
||||
let oauth2_module =
|
||||
create_instance::<msgIOAuth2Module>(c"@mozilla.org/mail/oauth2-module;1").ok_or(
|
||||
create_instance::<msgIOAuth2Module>(cstr!("@mozilla.org/mail/oauth2-module;1")).ok_or(
|
||||
Err::<RefPtr<msgIOAuth2Module>, _>(nserror::NS_ERROR_FAILURE),
|
||||
)?;
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче