Skip to content

Commit abd98d4

Browse files
authored
Merge pull request #972 from pkgw/build-fix
CI fixes
2 parents d86b209 + e82f0df commit abd98d4

8 files changed

Lines changed: 63 additions & 82 deletions

File tree

Cargo.lock

Lines changed: 48 additions & 47 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/bridge_core/src/lib.rs

Lines changed: 6 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2016-2021 the Tectonic Project
1+
// Copyright 2016-2022 the Tectonic Project
22
// Licensed under the MIT License.
33

44
#![deny(missing_docs)]
@@ -817,11 +817,7 @@ pub unsafe extern "C" fn ttbc_get_file_md5(
817817
let rpath = CStr::from_ptr(path).to_string_lossy();
818818
let rdest = slice::from_raw_parts_mut(digest, 16);
819819

820-
if es.get_file_md5(rpath.as_ref(), rdest) {
821-
1
822-
} else {
823-
0
824-
}
820+
libc::c_int::from(es.get_file_md5(rpath.as_ref(), rdest))
825821
}
826822

827823
/// Calculate the MD5 digest of a block of binary data.
@@ -917,11 +913,7 @@ pub extern "C" fn ttbc_output_flush(
917913
es: &mut CoreBridgeState,
918914
handle: *mut OutputHandle,
919915
) -> libc::c_int {
920-
if es.output_flush(handle) {
921-
1
922-
} else {
923-
0
924-
}
916+
libc::c_int::from(es.output_flush(handle))
925917
}
926918

927919
/// Close a Tectonic output file.
@@ -934,11 +926,7 @@ pub extern "C" fn ttbc_output_close(
934926
return 0; // This is/was the behavior of close_file() in C.
935927
}
936928

937-
if es.output_close(handle) {
938-
1
939-
} else {
940-
0
941-
}
929+
libc::c_int::from(es.output_close(handle))
942930
}
943931

944932
/// Open a Tectonic file for input.
@@ -1137,11 +1125,7 @@ pub extern "C" fn ttbc_input_close(
11371125
return 0; // This is/was the behavior of close_file() in C.
11381126
}
11391127

1140-
if es.input_close(handle) {
1141-
1
1142-
} else {
1143-
0
1144-
}
1128+
libc::c_int::from(es.input_close(handle))
11451129
}
11461130

11471131
/// A buffer for diagnostic messages. Rust code does not need to use this type.
@@ -1214,11 +1198,7 @@ pub unsafe extern "C" fn ttbc_shell_escape(
12141198
}
12151199
};
12161200

1217-
if es.shell_escape(&rcmd) {
1218-
1
1219-
} else {
1220-
0
1221-
}
1201+
libc::c_int::from(es.shell_escape(&rcmd))
12221202
}
12231203

12241204
/// Different types of files that can be opened by TeX engines

crates/bundles/src/cache.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -762,5 +762,5 @@ fn ensure_cache_dir(root: &Path, path: &str) -> Result<PathBuf> {
762762

763763
/// Convenience to generate a text filename
764764
fn make_txt_path(base: &Path, name: &str) -> PathBuf {
765-
base.join(&name).with_extension("txt")
765+
base.join(name).with_extension("txt")
766766
}

crates/bundles/src/dir.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ impl Bundle for DirBundle {
6060
let mut files = Vec::new();
6161

6262
// We intentionally do not explore the directory recursively.
63-
for entry in fs::read_dir(&self.0.root())? {
63+
for entry in fs::read_dir(self.0.root())? {
6464
let entry = entry?;
6565

6666
// This catches both regular files and symlinks:`

crates/engine_xdvipdfmx/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,8 @@ impl XdvipdfmxEngine {
118118

119119
let config = c_api::XdvipdfmxConfig {
120120
paperspec: paperspec_str.as_c_str().as_ptr(),
121-
enable_compression: if self.enable_compression { 1 } else { 0 },
122-
deterministic_tags: if self.deterministic_tags { 1 } else { 0 },
121+
enable_compression: u8::from(self.enable_compression),
122+
deterministic_tags: u8::from(self.deterministic_tags),
123123
build_date: self
124124
.build_date
125125
.duration_since(SystemTime::UNIX_EPOCH)

crates/xdv/examples/xdvdump.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ fn main() {
164164

165165
let path = matches.value_of_os("PATH").unwrap();
166166

167-
let file = match File::open(&path) {
167+
let file = match File::open(path) {
168168
Ok(f) => f,
169169
Err(e) => {
170170
eprintln!(

src/driver.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ impl BridgeState {
359359

360360
if tool_parent != tempdir.path() {
361361
ctry!(
362-
std::fs::create_dir_all(&tool_parent);
362+
std::fs::create_dir_all(tool_parent);
363363
"failed to create sub directory `{}`", tool_parent.display()
364364
);
365365
}
@@ -740,7 +740,7 @@ impl DriverHooks for BridgeState {
740740

741741
match Command::new(SHELL[0])
742742
.args(&SHELL[1..])
743-
.arg(&command)
743+
.arg(command)
744744
.current_dir(work.root())
745745
.status()
746746
{

0 commit comments

Comments
 (0)