Skip to content

Commit

Permalink
swap deflate for zlib encoder
Browse files Browse the repository at this point in the history
  • Loading branch information
nkzou committed Mar 26, 2024
1 parent 270f36c commit b5148ff
Show file tree
Hide file tree
Showing 71 changed files with 307 additions and 307 deletions.
4 changes: 2 additions & 2 deletions .generator/src/generator/templates/api.j2
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use log::warn;
{%- for _, _, operation in operations if operation.requestBody is defined and not operation|form_parameter %}
{%- if loop.first %}
use std::io::Write;
use flate2::{write::{GzEncoder, DeflateEncoder}, Compression};
use flate2::{write::{GzEncoder, ZlibEncoder}, Compression};
{%- endif %}
{%- endfor %}

Expand Down Expand Up @@ -396,7 +396,7 @@ impl {{ structName }} {
}
}
"deflate" => {
let mut enc = DeflateEncoder::new(
let mut enc = ZlibEncoder::new(
Vec::new(),
Compression::default(),
);
Expand Down
18 changes: 9 additions & 9 deletions src/datadogV1/api/api_aws_integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// Copyright 2019-Present Datadog, Inc.
use crate::datadog::*;
use flate2::{
write::{DeflateEncoder, GzEncoder},
write::{GzEncoder, ZlibEncoder},
Compression,
};
use reqwest;
Expand Down Expand Up @@ -337,7 +337,7 @@ impl AWSIntegrationAPI {
}
}
"deflate" => {
let mut enc = DeflateEncoder::new(Vec::new(), Compression::default());
let mut enc = ZlibEncoder::new(Vec::new(), Compression::default());
let _ = enc.write_all(ser.into_inner().as_slice());
match enc.finish() {
Ok(buf) => {
Expand Down Expand Up @@ -499,7 +499,7 @@ impl AWSIntegrationAPI {
}
}
"deflate" => {
let mut enc = DeflateEncoder::new(Vec::new(), Compression::default());
let mut enc = ZlibEncoder::new(Vec::new(), Compression::default());
let _ = enc.write_all(ser.into_inner().as_slice());
match enc.finish() {
Ok(buf) => {
Expand Down Expand Up @@ -656,7 +656,7 @@ impl AWSIntegrationAPI {
}
}
"deflate" => {
let mut enc = DeflateEncoder::new(Vec::new(), Compression::default());
let mut enc = ZlibEncoder::new(Vec::new(), Compression::default());
let _ = enc.write_all(ser.into_inner().as_slice());
match enc.finish() {
Ok(buf) => {
Expand Down Expand Up @@ -813,7 +813,7 @@ impl AWSIntegrationAPI {
}
}
"deflate" => {
let mut enc = DeflateEncoder::new(Vec::new(), Compression::default());
let mut enc = ZlibEncoder::new(Vec::new(), Compression::default());
let _ = enc.write_all(ser.into_inner().as_slice());
match enc.finish() {
Ok(buf) => {
Expand Down Expand Up @@ -970,7 +970,7 @@ impl AWSIntegrationAPI {
}
}
"deflate" => {
let mut enc = DeflateEncoder::new(Vec::new(), Compression::default());
let mut enc = ZlibEncoder::new(Vec::new(), Compression::default());
let _ = enc.write_all(ser.into_inner().as_slice());
match enc.finish() {
Ok(buf) => {
Expand Down Expand Up @@ -1132,7 +1132,7 @@ impl AWSIntegrationAPI {
}
}
"deflate" => {
let mut enc = DeflateEncoder::new(Vec::new(), Compression::default());
let mut enc = ZlibEncoder::new(Vec::new(), Compression::default());
let _ = enc.write_all(ser.into_inner().as_slice());
match enc.finish() {
Ok(buf) => {
Expand Down Expand Up @@ -1289,7 +1289,7 @@ impl AWSIntegrationAPI {
}
}
"deflate" => {
let mut enc = DeflateEncoder::new(Vec::new(), Compression::default());
let mut enc = ZlibEncoder::new(Vec::new(), Compression::default());
let _ = enc.write_all(ser.into_inner().as_slice());
match enc.finish() {
Ok(buf) => {
Expand Down Expand Up @@ -1909,7 +1909,7 @@ impl AWSIntegrationAPI {
}
}
"deflate" => {
let mut enc = DeflateEncoder::new(Vec::new(), Compression::default());
let mut enc = ZlibEncoder::new(Vec::new(), Compression::default());
let _ = enc.write_all(ser.into_inner().as_slice());
match enc.finish() {
Ok(buf) => {
Expand Down
12 changes: 6 additions & 6 deletions src/datadogV1/api/api_aws_logs_integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// Copyright 2019-Present Datadog, Inc.
use crate::datadog::*;
use flate2::{
write::{DeflateEncoder, GzEncoder},
write::{GzEncoder, ZlibEncoder},
Compression,
};
use reqwest;
Expand Down Expand Up @@ -228,7 +228,7 @@ impl AWSLogsIntegrationAPI {
}
}
"deflate" => {
let mut enc = DeflateEncoder::new(Vec::new(), Compression::default());
let mut enc = ZlibEncoder::new(Vec::new(), Compression::default());
let _ = enc.write_all(ser.into_inner().as_slice());
match enc.finish() {
Ok(buf) => {
Expand Down Expand Up @@ -406,7 +406,7 @@ impl AWSLogsIntegrationAPI {
}
}
"deflate" => {
let mut enc = DeflateEncoder::new(Vec::new(), Compression::default());
let mut enc = ZlibEncoder::new(Vec::new(), Compression::default());
let _ = enc.write_all(ser.into_inner().as_slice());
match enc.finish() {
Ok(buf) => {
Expand Down Expand Up @@ -563,7 +563,7 @@ impl AWSLogsIntegrationAPI {
}
}
"deflate" => {
let mut enc = DeflateEncoder::new(Vec::new(), Compression::default());
let mut enc = ZlibEncoder::new(Vec::new(), Compression::default());
let _ = enc.write_all(ser.into_inner().as_slice());
match enc.finish() {
Ok(buf) => {
Expand Down Expand Up @@ -720,7 +720,7 @@ impl AWSLogsIntegrationAPI {
}
}
"deflate" => {
let mut enc = DeflateEncoder::new(Vec::new(), Compression::default());
let mut enc = ZlibEncoder::new(Vec::new(), Compression::default());
let _ = enc.write_all(ser.into_inner().as_slice());
match enc.finish() {
Ok(buf) => {
Expand Down Expand Up @@ -879,7 +879,7 @@ impl AWSLogsIntegrationAPI {
}
}
"deflate" => {
let mut enc = DeflateEncoder::new(Vec::new(), Compression::default());
let mut enc = ZlibEncoder::new(Vec::new(), Compression::default());
let _ = enc.write_all(ser.into_inner().as_slice());
match enc.finish() {
Ok(buf) => {
Expand Down
10 changes: 5 additions & 5 deletions src/datadogV1/api/api_azure_integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// Copyright 2019-Present Datadog, Inc.
use crate::datadog::*;
use flate2::{
write::{DeflateEncoder, GzEncoder},
write::{GzEncoder, ZlibEncoder},
Compression,
};
use reqwest;
Expand Down Expand Up @@ -209,7 +209,7 @@ impl AzureIntegrationAPI {
}
}
"deflate" => {
let mut enc = DeflateEncoder::new(Vec::new(), Compression::default());
let mut enc = ZlibEncoder::new(Vec::new(), Compression::default());
let _ = enc.write_all(ser.into_inner().as_slice());
match enc.finish() {
Ok(buf) => {
Expand Down Expand Up @@ -368,7 +368,7 @@ impl AzureIntegrationAPI {
}
}
"deflate" => {
let mut enc = DeflateEncoder::new(Vec::new(), Compression::default());
let mut enc = ZlibEncoder::new(Vec::new(), Compression::default());
let _ = enc.write_all(ser.into_inner().as_slice());
match enc.finish() {
Ok(buf) => {
Expand Down Expand Up @@ -631,7 +631,7 @@ impl AzureIntegrationAPI {
}
}
"deflate" => {
let mut enc = DeflateEncoder::new(Vec::new(), Compression::default());
let mut enc = ZlibEncoder::new(Vec::new(), Compression::default());
let _ = enc.write_all(ser.into_inner().as_slice());
match enc.finish() {
Ok(buf) => {
Expand Down Expand Up @@ -794,7 +794,7 @@ impl AzureIntegrationAPI {
}
}
"deflate" => {
let mut enc = DeflateEncoder::new(Vec::new(), Compression::default());
let mut enc = ZlibEncoder::new(Vec::new(), Compression::default());
let _ = enc.write_all(ser.into_inner().as_slice());
match enc.finish() {
Ok(buf) => {
Expand Down
6 changes: 3 additions & 3 deletions src/datadogV1/api/api_dashboard_lists.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// Copyright 2019-Present Datadog, Inc.
use crate::datadog::*;
use flate2::{
write::{DeflateEncoder, GzEncoder},
write::{GzEncoder, ZlibEncoder},
Compression,
};
use reqwest;
Expand Down Expand Up @@ -194,7 +194,7 @@ impl DashboardListsAPI {
}
}
"deflate" => {
let mut enc = DeflateEncoder::new(Vec::new(), Compression::default());
let mut enc = ZlibEncoder::new(Vec::new(), Compression::default());
let _ = enc.write_all(ser.into_inner().as_slice());
match enc.finish() {
Ok(buf) => {
Expand Down Expand Up @@ -673,7 +673,7 @@ impl DashboardListsAPI {
}
}
"deflate" => {
let mut enc = DeflateEncoder::new(Vec::new(), Compression::default());
let mut enc = ZlibEncoder::new(Vec::new(), Compression::default());
let _ = enc.write_all(ser.into_inner().as_slice());
match enc.finish() {
Ok(buf) => {
Expand Down
18 changes: 9 additions & 9 deletions src/datadogV1/api/api_dashboards.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
use crate::datadog::*;
use async_stream::try_stream;
use flate2::{
write::{DeflateEncoder, GzEncoder},
write::{GzEncoder, ZlibEncoder},
Compression,
};
use futures_core::stream::Stream;
Expand Down Expand Up @@ -355,7 +355,7 @@ impl DashboardsAPI {
}
}
"deflate" => {
let mut enc = DeflateEncoder::new(Vec::new(), Compression::default());
let mut enc = ZlibEncoder::new(Vec::new(), Compression::default());
let _ = enc.write_all(ser.into_inner().as_slice());
match enc.finish() {
Ok(buf) => {
Expand Down Expand Up @@ -509,7 +509,7 @@ impl DashboardsAPI {
}
}
"deflate" => {
let mut enc = DeflateEncoder::new(Vec::new(), Compression::default());
let mut enc = ZlibEncoder::new(Vec::new(), Compression::default());
let _ = enc.write_all(ser.into_inner().as_slice());
match enc.finish() {
Ok(buf) => {
Expand Down Expand Up @@ -763,7 +763,7 @@ impl DashboardsAPI {
}
}
"deflate" => {
let mut enc = DeflateEncoder::new(Vec::new(), Compression::default());
let mut enc = ZlibEncoder::new(Vec::new(), Compression::default());
let _ = enc.write_all(ser.into_inner().as_slice());
match enc.finish() {
Ok(buf) => {
Expand Down Expand Up @@ -1021,7 +1021,7 @@ impl DashboardsAPI {
}
}
"deflate" => {
let mut enc = DeflateEncoder::new(Vec::new(), Compression::default());
let mut enc = ZlibEncoder::new(Vec::new(), Compression::default());
let _ = enc.write_all(ser.into_inner().as_slice());
match enc.finish() {
Ok(buf) => {
Expand Down Expand Up @@ -1672,7 +1672,7 @@ impl DashboardsAPI {
}
}
"deflate" => {
let mut enc = DeflateEncoder::new(Vec::new(), Compression::default());
let mut enc = ZlibEncoder::new(Vec::new(), Compression::default());
let _ = enc.write_all(ser.into_inner().as_slice());
match enc.finish() {
Ok(buf) => {
Expand Down Expand Up @@ -1830,7 +1830,7 @@ impl DashboardsAPI {
}
}
"deflate" => {
let mut enc = DeflateEncoder::new(Vec::new(), Compression::default());
let mut enc = ZlibEncoder::new(Vec::new(), Compression::default());
let _ = enc.write_all(ser.into_inner().as_slice());
match enc.finish() {
Ok(buf) => {
Expand Down Expand Up @@ -1990,7 +1990,7 @@ impl DashboardsAPI {
}
}
"deflate" => {
let mut enc = DeflateEncoder::new(Vec::new(), Compression::default());
let mut enc = ZlibEncoder::new(Vec::new(), Compression::default());
let _ = enc.write_all(ser.into_inner().as_slice());
match enc.finish() {
Ok(buf) => {
Expand Down Expand Up @@ -2150,7 +2150,7 @@ impl DashboardsAPI {
}
}
"deflate" => {
let mut enc = DeflateEncoder::new(Vec::new(), Compression::default());
let mut enc = ZlibEncoder::new(Vec::new(), Compression::default());
let _ = enc.write_all(ser.into_inner().as_slice());
match enc.finish() {
Ok(buf) => {
Expand Down
8 changes: 4 additions & 4 deletions src/datadogV1/api/api_downtimes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// Copyright 2019-Present Datadog, Inc.
use crate::datadog::*;
use flate2::{
write::{DeflateEncoder, GzEncoder},
write::{GzEncoder, ZlibEncoder},
Compression,
};
use reqwest;
Expand Down Expand Up @@ -332,7 +332,7 @@ impl DowntimesAPI {
}
}
"deflate" => {
let mut enc = DeflateEncoder::new(Vec::new(), Compression::default());
let mut enc = ZlibEncoder::new(Vec::new(), Compression::default());
let _ = enc.write_all(ser.into_inner().as_slice());
match enc.finish() {
Ok(buf) => {
Expand Down Expand Up @@ -486,7 +486,7 @@ impl DowntimesAPI {
}
}
"deflate" => {
let mut enc = DeflateEncoder::new(Vec::new(), Compression::default());
let mut enc = ZlibEncoder::new(Vec::new(), Compression::default());
let _ = enc.write_all(ser.into_inner().as_slice());
match enc.finish() {
Ok(buf) => {
Expand Down Expand Up @@ -965,7 +965,7 @@ impl DowntimesAPI {
}
}
"deflate" => {
let mut enc = DeflateEncoder::new(Vec::new(), Compression::default());
let mut enc = ZlibEncoder::new(Vec::new(), Compression::default());
let _ = enc.write_all(ser.into_inner().as_slice());
match enc.finish() {
Ok(buf) => {
Expand Down
4 changes: 2 additions & 2 deletions src/datadogV1/api/api_events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// Copyright 2019-Present Datadog, Inc.
use crate::datadog::*;
use flate2::{
write::{DeflateEncoder, GzEncoder},
write::{GzEncoder, ZlibEncoder},
Compression,
};
use reqwest;
Expand Down Expand Up @@ -224,7 +224,7 @@ impl EventsAPI {
}
}
"deflate" => {
let mut enc = DeflateEncoder::new(Vec::new(), Compression::default());
let mut enc = ZlibEncoder::new(Vec::new(), Compression::default());
let _ = enc.write_all(ser.into_inner().as_slice());
match enc.finish() {
Ok(buf) => {
Expand Down
8 changes: 4 additions & 4 deletions src/datadogV1/api/api_gcp_integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// Copyright 2019-Present Datadog, Inc.
use crate::datadog::*;
use flate2::{
write::{DeflateEncoder, GzEncoder},
write::{GzEncoder, ZlibEncoder},
Compression,
};
use reqwest;
Expand Down Expand Up @@ -187,7 +187,7 @@ impl GCPIntegrationAPI {
}
}
"deflate" => {
let mut enc = DeflateEncoder::new(Vec::new(), Compression::default());
let mut enc = ZlibEncoder::new(Vec::new(), Compression::default());
let _ = enc.write_all(ser.into_inner().as_slice());
match enc.finish() {
Ok(buf) => {
Expand Down Expand Up @@ -346,7 +346,7 @@ impl GCPIntegrationAPI {
}
}
"deflate" => {
let mut enc = DeflateEncoder::new(Vec::new(), Compression::default());
let mut enc = ZlibEncoder::new(Vec::new(), Compression::default());
let _ = enc.write_all(ser.into_inner().as_slice());
match enc.finish() {
Ok(buf) => {
Expand Down Expand Up @@ -614,7 +614,7 @@ impl GCPIntegrationAPI {
}
}
"deflate" => {
let mut enc = DeflateEncoder::new(Vec::new(), Compression::default());
let mut enc = ZlibEncoder::new(Vec::new(), Compression::default());
let _ = enc.write_all(ser.into_inner().as_slice());
match enc.finish() {
Ok(buf) => {
Expand Down
Loading

0 comments on commit b5148ff

Please sign in to comment.