Skip to content

Commit ffcfd99

Browse files
committed
derive Serialize for DebugInfo
1 parent e493b87 commit ffcfd99

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

src/cargo/core/profiles.rs

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -737,7 +737,8 @@ impl Profile {
737737
/// would inhibit reuse and build a unit twice. By deferring the choice until we
738738
/// know whether to choose the optimized value or the default value to ensure
739739
/// reuse in the unit graph.
740-
#[derive(Debug, Copy, Clone)]
740+
#[derive(Debug, Copy, Clone, serde::Serialize)]
741+
#[serde(untagged)]
741742
pub enum DebugInfo {
742743
/// No debuginfo level was set.
743744
None,
@@ -788,15 +789,6 @@ impl DebugInfo {
788789
}
789790
}
790791

791-
impl serde::Serialize for DebugInfo {
792-
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
793-
where
794-
S: serde::Serializer,
795-
{
796-
self.to_option().serialize(serializer)
797-
}
798-
}
799-
800792
impl PartialEq for DebugInfo {
801793
fn eq(&self, other: &DebugInfo) -> bool {
802794
self.to_option().eq(&other.to_option())

0 commit comments

Comments
 (0)