Don't trigger warnings draft
authorJan-Erik Rediger <janerik@fnordig.de>
Mon, 19 Apr 2021 18:10:36 +0200
changeset 3667573 b1267e954b65ce2cf4dee13b4e3446f98c779012
parent 3667488 d3880b1ea3aeafd37cc2f0ffe29210e1266a2e24
child 3667574 4a107589ddf21c256849d80ca9ec2ce703b8172e
push id683114
push userjrediger@mozilla.com
push dateMon, 19 Apr 2021 16:25:02 +0000
treeherdertry@4a107589ddf2 [default view] [failures only]
milestone89.0a1
Don't trigger warnings
toolkit/components/glean/src/lib.rs
--- a/toolkit/components/glean/src/lib.rs
+++ b/toolkit/components/glean/src/lib.rs
@@ -23,33 +23,39 @@ pub extern crate fog;
 
 pub use glean_ffi;
 
 #[no_mangle]
 pub unsafe extern "C" fn _fog_force_reexport_donotcall() {
     glean_ffi::glean_enable_logging();
 }
 
+#[cfg(not(target_os = "android"))]
 #[macro_use]
 extern crate cstr;
+#[cfg(not(target_os = "android"))]
 #[macro_use]
 extern crate xpcom;
 
+#[cfg(not(target_os = "android"))]
 use std::ffi::CStr;
+#[cfg(not(target_os = "android"))]
 use std::os::raw::c_char;
 #[cfg(not(target_os = "android"))]
 use std::path::PathBuf;
 
 use nserror::{nsresult, NS_ERROR_FAILURE, NS_OK};
-use nsstring::{nsACString, nsCStr, nsCString, nsString};
+use nsstring::nsACString;
+#[cfg(not(target_os = "android"))]
+use nsstring::{nsCStr, nsCString, nsString};
+#[cfg(not(target_os = "android"))]
 use xpcom::interfaces::{
-    nsIFile, nsIObserver, nsIPrefBranch, nsISupports, nsIXULAppInfo,
+    mozIViaduct, nsIFile, nsIObserver, nsIPrefBranch, nsISupports, nsIXULAppInfo,
 };
 #[cfg(not(target_os = "android"))]
-use xpcom::interfaces::mozIViaduct;
 use xpcom::{RefPtr, XpCom};
 
 #[cfg(not(target_os = "android"))]
 use glean::{ClientInfoMetrics, Configuration};
 
 #[cfg(not(target_os = "android"))]
 mod user_activity;
 #[cfg(not(target_os = "android"))]
@@ -196,16 +202,17 @@ fn get_data_path() -> Result<String, nsr
     let data_path = profile_path + "/datareporting/glean";
     Ok(data_path)
 }
 
 /// Return a tuple of the build_id, app version, and build channel.
 /// If the XUL Runtime isn't a XULAppInfo (e.g. in xpcshell),
 /// build_id ad app_version will be "unknown".
 /// Other problems result in an error being returned instead.
+#[cfg(not(target_os = "android"))]
 fn get_app_info() -> Result<(String, String, String), nsresult> {
     let xul = xpcom::services::get_XULRuntime().ok_or(NS_ERROR_FAILURE)?;
 
     let mut channel = nsCString::new();
     unsafe {
         xul.GetDefaultUpdateChannel(&mut *channel).to_result()?;
     }