Skip to content

Commit

Permalink
Merge pull request #10 from Traverse-Research/fix-ci
Browse files Browse the repository at this point in the history
😁 Fix clippy warnings to make the CI happy
  • Loading branch information
tosti007 authored Oct 22, 2024
2 parents dc16109 + ba1268f commit 1051339
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 25 deletions.
2 changes: 1 addition & 1 deletion apk/src/res.rs
Original file line number Diff line number Diff line change
Expand Up @@ -932,7 +932,7 @@ impl Chunk {
break;
}
}
let s = String::from_utf16(unsafe { std::mem::transmute(buf.as_slice()) })?;
let s = String::from_utf16(buf.as_slice())?;
strings.push(s);
}
}
Expand Down
28 changes: 15 additions & 13 deletions msix/src/manifest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -264,9 +264,9 @@ mod tests {
#[test]
fn test_properties() {
let props = Properties {
display_name: Some("".into()),
publisher_display_name: Some("".into()),
logo: Some("".into()),
display_name: "".into(),
publisher_display_name: "".into(),
logo: "".into(),
description: Some("".into()),
};
let xml = quick_xml::se::to_string(&props).unwrap();
Expand All @@ -283,14 +283,16 @@ mod tests {
processor_architecture: Some("x64".into()),
},
properties: Properties {
display_name: Some("fluttertodoapp".into()),
publisher_display_name: Some("com.flutter.fluttertodoapp".into()),
logo: Some("Images\\StoreLogo.png".into()),
display_name: "fluttertodoapp".into(),
publisher_display_name: "com.flutter.fluttertodoapp".into(),
logo: "Images\\StoreLogo.png".into(),
description: Some("A new Flutter project.".into()),
},
resources: Resources {
resource: vec![Resource {
language: "en".into(),
language: Some("en".into()),
scale: None,
dx_feature_level: None,
}],
},
dependencies: Dependencies {
Expand All @@ -309,15 +311,15 @@ mod tests {
],
applications: Applications {
application: vec![Application {
id: Some("fluttertodoapp".into()),
id: "fluttertodoapp".into(),
executable: Some("todoapp.exe".into()),
entry_point: Some("Windows.FullTrustApplication".into()),
visual_elements: VisualElements {
background_color: Some("transparent".into()),
display_name: Some("fluttertodoapp".into()),
description: Some("A new flutter project.".into()),
logo_44x44: Some("Images\\Square44x44Logo.png".into()),
logo_150x150: Some("Images\\Square150x150Logo.png".into()),
background_color: "transparent".into(),
display_name: "fluttertodoapp".into(),
description: "A new flutter project.".into(),
logo_44x44: "Images\\Square44x44Logo.png".into(),
logo_150x150: "Images\\Square150x150Logo.png".into(),
default_tile: Some(DefaultTile {
short_name: Some("fluttertodoapp".into()),
logo_71x71: Some("Images\\SmallTile.png".into()),
Expand Down
6 changes: 1 addition & 5 deletions mvn/src/pom.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,7 @@ pub struct Pom {

impl Pom {
pub fn packaging(&self) -> &str {
if let Some(s) = self.packaging.as_deref() {
s
} else {
"jar"
}
self.packaging.as_deref().unwrap_or("jar")
}

pub fn dependencies(&self) -> &[Dependency] {
Expand Down
4 changes: 1 addition & 3 deletions xbuild/src/cargo/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ use self::config::LocalizedConfig;
use self::manifest::Manifest;
use crate::{CompileTarget, Opt};

const SEP: &str = "\x1f";

pub enum FeatureSpecification {
List(Vec<String>),
All,
Expand Down Expand Up @@ -331,7 +329,7 @@ impl CargoBuild {
}

pub fn use_android_jar(&mut self, path: &Path) {
self.cmd.env("XBUILD_ANDROID_JAR", &path);
self.cmd.env("XBUILD_ANDROID_JAR", path);
}

pub fn use_windows_sdk(&mut self, path: &Path) -> Result<()> {
Expand Down
2 changes: 1 addition & 1 deletion xbuild/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use anyhow::{Context, Result};
use apk::manifest::{Activity, AndroidManifest, IntentFilter, MetaData};
use apk::VersionCode;
use appbundle::InfoPlist;
use msix::manifest::{Application, ApplicationKind};
use msix::manifest::Application;
use msix::AppxManifest;
use serde::Deserialize;
use std::collections::HashMap;
Expand Down
2 changes: 1 addition & 1 deletion xcommon/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ fn find_cde_start_pos<R: Read + Seek>(reader: &mut R) -> Result<u64> {
const CENTRAL_DIRECTORY_END_SIGNATURE: u32 = 0x06054b50;
const HEADER_SIZE: u64 = 22;
let file_length = reader.seek(SeekFrom::End(0))?;
let search_upper_bound = file_length.saturating_sub(HEADER_SIZE + ::std::u16::MAX as u64);
let search_upper_bound = file_length.saturating_sub(HEADER_SIZE + u16::MAX as u64);
anyhow::ensure!(file_length >= HEADER_SIZE, "Invalid zip header");
let mut pos = file_length - HEADER_SIZE;
while pos >= search_upper_bound {
Expand Down
2 changes: 1 addition & 1 deletion xcommon/src/llvm.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! LLVM utilities
use anyhow::{bail, ensure, Context, Result};
use anyhow::{ensure, Context, Result};
use std::collections::HashSet;
use std::ffi::{OsStr, OsString};
use std::path::{Path, PathBuf};
Expand Down

0 comments on commit 1051339

Please sign in to comment.