Skip to content

Commit b20d9e9

Browse files
committed
Merge branch 'copilot/fix-issue-2258'
2 parents 422c5b5 + b170451 commit b20d9e9

File tree

4 files changed

+16
-10
lines changed

4 files changed

+16
-10
lines changed

gitoxide-core/src/repository/odb.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,15 @@ pub fn info(
1717

1818
#[cfg_attr(feature = "serde", derive(serde::Serialize))]
1919
pub struct Statistics {
20+
#[cfg_attr(not(feature = "serde"), allow(dead_code))]
2021
pub path: std::path::PathBuf,
22+
#[cfg_attr(not(feature = "serde"), allow(dead_code))]
2123
pub object_hash: String,
24+
#[cfg_attr(not(feature = "serde"), allow(dead_code))]
2225
pub use_multi_pack_index: bool,
26+
#[cfg_attr(not(feature = "serde"), allow(dead_code))]
2327
pub structure: Vec<gix::odb::store::structure::Record>,
28+
#[cfg_attr(not(feature = "serde"), allow(dead_code))]
2429
pub metrics: gix::odb::store::Metrics,
2530
}
2631

gitoxide-core/src/repository/tree.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ mod entries {
2525
pub num_blobs_exec: usize,
2626
pub num_submodules: usize,
2727
#[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
28+
#[cfg_attr(not(feature = "serde"), allow(dead_code))]
2829
pub bytes: Option<u64>,
2930
#[cfg_attr(feature = "serde", serde(skip))]
3031
pub num_bytes: u64,

gix/src/config/tree/sections/core.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -478,41 +478,41 @@ mod validate {
478478
}
479479
}
480480

481+
#[cfg(feature = "attributes")]
481482
pub struct SafeCrlf;
483+
#[cfg(feature = "attributes")]
482484
impl keys::Validate for SafeCrlf {
483-
#[cfg_attr(not(feature = "attributes"), allow(unused_variables))]
484485
fn validate(&self, value: &BStr) -> Result<(), Box<dyn std::error::Error + Send + Sync + 'static>> {
485-
#[cfg(feature = "attributes")]
486486
super::Core::SAFE_CRLF.try_into_safecrlf(value.into())?;
487487
Ok(())
488488
}
489489
}
490490

491+
#[cfg(feature = "attributes")]
491492
pub struct AutoCrlf;
493+
#[cfg(feature = "attributes")]
492494
impl keys::Validate for AutoCrlf {
493-
#[cfg_attr(not(feature = "attributes"), allow(unused_variables))]
494495
fn validate(&self, value: &BStr) -> Result<(), Box<dyn std::error::Error + Send + Sync + 'static>> {
495-
#[cfg(feature = "attributes")]
496496
super::Core::AUTO_CRLF.try_into_autocrlf(value.into())?;
497497
Ok(())
498498
}
499499
}
500500

501+
#[cfg(feature = "attributes")]
501502
pub struct Eol;
503+
#[cfg(feature = "attributes")]
502504
impl keys::Validate for Eol {
503-
#[cfg_attr(not(feature = "attributes"), allow(unused_variables))]
504505
fn validate(&self, value: &BStr) -> Result<(), Box<dyn std::error::Error + Send + Sync + 'static>> {
505-
#[cfg(feature = "attributes")]
506506
super::Core::EOL.try_into_eol(value.into())?;
507507
Ok(())
508508
}
509509
}
510510

511+
#[cfg(feature = "attributes")]
511512
pub struct CheckRoundTripEncoding;
513+
#[cfg(feature = "attributes")]
512514
impl keys::Validate for CheckRoundTripEncoding {
513-
#[cfg_attr(not(feature = "attributes"), allow(unused_variables))]
514515
fn validate(&self, value: &BStr) -> Result<(), Box<dyn std::error::Error + Send + Sync + 'static>> {
515-
#[cfg(feature = "attributes")]
516516
super::Core::CHECK_ROUND_TRIP_ENCODING.try_into_encodings(Some(value.into()))?;
517517
Ok(())
518518
}

gix/src/config/tree/sections/fetch.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,11 @@ mod validate {
8787
}
8888
}
8989

90+
#[cfg(feature = "attributes")]
9091
pub struct RecurseSubmodules;
92+
#[cfg(feature = "attributes")]
9193
impl keys::Validate for RecurseSubmodules {
92-
#[cfg_attr(not(feature = "attributes"), allow(unused_variables))]
9394
fn validate(&self, value: &BStr) -> Result<(), Box<dyn std::error::Error + Send + Sync + 'static>> {
94-
#[cfg(feature = "attributes")]
9595
{
9696
let boolean = gix_config::Boolean::try_from(value).map(|b| b.0);
9797
crate::config::tree::Fetch::RECURSE_SUBMODULES.try_into_recurse_submodules(boolean)?;

0 commit comments

Comments
 (0)