Unverified Commit 62410818 authored by Nugine's avatar Nugine
Browse files

codegen: dto: rename special variant

parent 268ee191
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -99,7 +99,10 @@ pub fn collect_rust_types(model: &smithy::Model, ops: &Operations) -> RustTypes
            smithy::Shape::Enum(shape) => {
                let mut variants = Vec::new();
                for (variant_name, variant) in &shape.members {
                    let name = variant_name.to_upper_camel_case();
                    let name = match variant_name.as_str() {
                        "CRC32C" => o("Crc32C"),
                        _ => variant_name.to_upper_camel_case(),
                    };

                    let value = variant.traits.enum_value().unwrap().to_owned();
                    assert!(value.is_ascii());
+3 −3
Original line number Diff line number Diff line
@@ -678,7 +678,7 @@ pub struct Checksum {
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum ChecksumAlgorithm {
    Crc32,
    Crc32c,
    Crc32C,
    Sha1,
    Sha256,
}
@@ -688,7 +688,7 @@ impl ChecksumAlgorithm {
    pub const fn as_str(&self) -> &'static str {
        match self {
            Self::Crc32 => "CRC32",
            Self::Crc32c => "CRC32C",
            Self::Crc32C => "CRC32C",
            Self::Sha1 => "SHA1",
            Self::Sha256 => "SHA256",
        }
@@ -698,7 +698,7 @@ impl ChecksumAlgorithm {
    pub const fn from_bytes(s: &[u8]) -> Option<Self> {
        match s {
            b"CRC32" => Some(Self::Crc32),
            b"CRC32C" => Some(Self::Crc32c),
            b"CRC32C" => Some(Self::Crc32C),
            b"SHA1" => Some(Self::Sha1),
            b"SHA256" => Some(Self::Sha256),
            _ => None,
+1 −1
Original line number Diff line number Diff line
@@ -11626,7 +11626,7 @@ impl http::TryIntoHeaderValue for ChecksumAlgorithm {
    fn try_into_header_value(self) -> Result<http::HeaderValue, Self::Error> {
        match self {
            Self::Crc32 => Ok(http::HeaderValue::from_static("{}")),
            Self::Crc32c => Ok(http::HeaderValue::from_static("{}")),
            Self::Crc32C => Ok(http::HeaderValue::from_static("{}")),
            Self::Sha1 => Ok(http::HeaderValue::from_static("{}")),
            Self::Sha256 => Ok(http::HeaderValue::from_static("{}")),
        }