Skip to content

Commit 51c3fba

Browse files
committed
derive Serialize for DebugInfo
1 parent d0b12c0 commit 51c3fba

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
/// cause to build a unit twice. By deferring the choice until we know
738738
/// whether to choose the optimized value or the default value, we can make sure
739739
/// the unit is only built once and the unit graph is still optimized.
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)