Skip to content

Commit b4701f5

Browse files
authored
Merge pull request #983 from caiogeraldes/master
V2 CLI: separate `new` and `init` commands
2 parents abd98d4 + cf9e093 commit b4701f5

19 files changed

Lines changed: 284 additions & 242 deletions

File tree

Cargo.lock

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

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ tokio = "0.1.22"
120120

121121
[package.metadata.vcpkg]
122122
git = "https://github.com/microsoft/vcpkg"
123-
rev = "1be5a98d090b1d2beeb63a48ba800fbf006e8aca"
123+
rev = "47a020d619021539a2533e56ef850696065b23a5"
124124
overlay-triplets-path = "dist/vcpkg-triplets"
125125

126126
# If other targets start using custom triplets like x86_64-pc-windows-msvc,

crates/bridge_flate/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ pub unsafe extern "C" fn tectonic_flate_compress(
7272
(c.total_out(), FlateResult::Success)
7373
};
7474

75-
*output_len = size as u64;
75+
*output_len = size;
7676
result
7777
}
7878

@@ -101,7 +101,7 @@ pub unsafe extern "C" fn tectonic_flate_decompress(
101101
Err(_) => (0, FlateResult::OtherError),
102102
};
103103

104-
*output_len = size as u64;
104+
*output_len = size;
105105
result
106106
}
107107

crates/bundles/src/cache.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,7 @@ impl<CB: CacheBackend> CachingBundle<CB> {
525525
// The resolved URL has changed, but the digest is the same. So
526526
// let's just update the URL and keep going.
527527
let resolved_path = make_txt_path(&self.resolved_base, &pull_data.digest.to_string());
528-
file_create_write(&resolved_path, |f| {
528+
file_create_write(resolved_path, |f| {
529529
f.write_all(pull_data.resolved_url.as_bytes())
530530
})?;
531531

@@ -647,7 +647,7 @@ impl<CB: CacheBackend> IoProvider for CachingBundle<CB> {
647647
OpenResult::Err(e) => return OpenResult::Err(e),
648648
};
649649

650-
let f = match File::open(&path) {
650+
let f = match File::open(path) {
651651
Ok(f) => f,
652652
Err(e) => return OpenResult::Err(e.into()),
653653
};

crates/xdv/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -954,7 +954,7 @@ impl<T: XdvEvents> XdvParser<T> {
954954
}
955955

956956
let char_num = cursor.get_compact_i32_smpos(opcode - Opcode::SetChar1 as u8)?;
957-
self.cur_char_run.push(char_num as i32);
957+
self.cur_char_run.push(char_num);
958958
Ok(())
959959
}
960960

crates/xetex_format/src/cshash.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ impl ControlSeqHash {
190190
// The 1 here is formally ACTIVE_BASE
191191
return Some(format!(
192192
"[active character {}]",
193-
crate::format::fmt_usv(p as i32 - 1)
193+
crate::format::fmt_usv(p - 1)
194194
));
195195
}
196196
}

crates/xetex_format/src/eqtb.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ impl EquivalenciesTable {
108108
engine.symbols.lookup("UNDEFINED_CONTROL_SEQUENCE") as EqtbPointer;
109109
let undefined_cs_cmd = engine.symbols.lookup("UNDEFINED_CS") as CommandCode;
110110

111-
let mut eqtb = vec![0; (eqtb_top as usize + 1) * SIZEOF_MEMORY_WORD];
111+
let mut eqtb = vec![0; (eqtb_top + 1) * SIZEOF_MEMORY_WORD];
112112

113113
write_eqtb_type(&mut eqtb[..], undefined_control_sequence, undefined_cs_cmd);
114114
write_eqtb_value(&mut eqtb[..], undefined_control_sequence, TEX_NULL);

crates/xetex_format/src/format.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ impl Format {
271271

272272
fn fmt_cs_pointer(&self, ptr: EqtbPointer) -> String {
273273
if let Some(text) = self.cshash.stringify(ptr, &self.strings) {
274-
fmt_csname(&text)
274+
fmt_csname(text)
275275
} else {
276276
format!("[undecodable cseq pointer {}]", ptr)
277277
}
@@ -314,7 +314,7 @@ fn parse_body(engine: Engine, input: &[u8]) -> IResult<&[u8], Format> {
314314
let (input, hash_high) = be_i32(input)?;
315315
let (input, _mem_top) = parseutils::satisfy_be_i32(mem_top)(input)?;
316316
let (input, _eqtb_size) = parseutils::satisfy_be_i32(eqtb_size)(input)?;
317-
let (input, _hash_prime) = parseutils::satisfy_be_i32(hash_prime as i32)(input)?;
317+
let (input, _hash_prime) = parseutils::satisfy_be_i32(hash_prime)(input)?;
318318
let (input, _hyph_prime) = be_i32(input)?;
319319

320320
// string table
@@ -330,9 +330,9 @@ fn parse_body(engine: Engine, input: &[u8]) -> IResult<&[u8], Format> {
330330
let (input, eqtb) = eqtb::EquivalenciesTable::parse(input, &engine, hash_high)?;
331331

332332
// nominally hash_top, but hash_top = eqtb_top since hash_extra is nonzero
333-
let (input, _par_loc) = parseutils::ranged_be_i32(hash_base as i32, eqtb_top as i32)(input)?;
333+
let (input, _par_loc) = parseutils::ranged_be_i32(hash_base, eqtb_top)(input)?;
334334

335-
let (input, _write_loc) = parseutils::ranged_be_i32(hash_base as i32, eqtb_top as i32)(input)?;
335+
let (input, _write_loc) = parseutils::ranged_be_i32(hash_base, eqtb_top)(input)?;
336336

337337
// Primitives. TODO: figure out best type for `prims`.
338338

@@ -349,7 +349,7 @@ fn parse_body(engine: Engine, input: &[u8]) -> IResult<&[u8], Format> {
349349
let (input, _font_info) = count(be_i64, fmem_ptr as usize)(input)?;
350350

351351
// NB: FONT_BASE = 0
352-
let (input, font_ptr) = parseutils::ranged_be_i32(0, max_fonts as i32)(input)?;
352+
let (input, font_ptr) = parseutils::ranged_be_i32(0, max_fonts)(input)?;
353353

354354
let n_fonts = font_ptr as usize + 1;
355355
let (input, _font_check) = count(be_i64, n_fonts)(input)?;

crates/xetex_format/src/mem.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ impl Memory {
4646

4747
// Compressed memory loading;
4848

49-
let mut mem = vec![0; (mem_top as usize + 1) * SIZEOF_MEMORY_WORD];
49+
let mut mem = vec![0; (mem_top + 1) * SIZEOF_MEMORY_WORD];
5050
let mut input = input;
5151
let mut p = 0;
5252
let mut q = rover;
@@ -72,7 +72,7 @@ impl Memory {
7272
}
7373

7474
// Loading the rest of low memory. TODO: straight into `mem`?
75-
let nb = (lo_mem_max + 1 - p as i32) as usize * SIZEOF_MEMORY_WORD;
75+
let nb = (lo_mem_max + 1 - p) as usize * SIZEOF_MEMORY_WORD;
7676
let (input, block) = count(be_u8, nb)(input)?;
7777
let idx = p as usize * SIZEOF_MEMORY_WORD;
7878
mem[idx..idx + nb].copy_from_slice(&block[..]);

docs/src/SUMMARY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
- [`tectonic -X compile`](v2cli/compile.md)
1717
- [`tectonic -X dump`](v2cli/dump.md)
1818
- [`tectonic -X new`](v2cli/new.md)
19+
- [`tectonic -X init`](v2cli/init.md)
1920
- [`tectonic -X show`](v2cli/show.md)
2021
- [`tectonic -X watch`](v2cli/watch.md)
2122

0 commit comments

Comments
 (0)