Skip to content

Commit b761517

Browse files
authored
Merge pull request #194 from rustcoreutils/hacking
gencat: fix warnings on macos
2 parents 253ee59 + 722a4e7 commit b761517

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

i18n/gencat.rs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,8 +258,16 @@ impl std::error::Error for ParseError {}
258258

259259
/// For set if it's $set NUMBER #COMMENT
260260
impl MessageCatalog {
261-
pub fn new(build_default: bool) -> Self {
262-
let mut catalog = MessageCatalog {
261+
pub fn new(
262+
#[cfg_attr(target_os = "macos", allow(unused_variables))] build_default: bool,
263+
) -> Self {
264+
#[cfg(target_os = "macos")]
265+
let catalog;
266+
267+
#[cfg(not(target_os = "macos"))]
268+
let mut catalog;
269+
270+
catalog = MessageCatalog {
263271
cat: Cat {
264272
first_set: None,
265273
last_set: None,
@@ -459,6 +467,7 @@ impl MessageCatalog {
459467
}
460468
}
461469

470+
#[cfg(not(target_os = "macos"))]
462471
fn compute_optimal_size(&self) -> (usize, usize) {
463472
let mut best_total = usize::MAX;
464473
let mut best_size = usize::MAX;
@@ -508,6 +517,7 @@ impl MessageCatalog {
508517
(best_size, best_depth)
509518
}
510519

520+
#[cfg(not(target_os = "macos"))]
511521
fn fill_arrays(&self, array: &mut [u32], string_pool: &mut Vec<u8>, best_size: usize) {
512522
for set in self.cat.all_sets().iter().rev() {
513523
let set = set.borrow();

0 commit comments

Comments
 (0)