Skip to content

Commit

Permalink
address semicolon_if_nothing_returned lint (#1295)
Browse files Browse the repository at this point in the history
  • Loading branch information
demoray authored Jun 7, 2023
1 parent acc7412 commit d8073da
Show file tree
Hide file tree
Showing 18 changed files with 43 additions and 43 deletions.
2 changes: 1 addition & 1 deletion eng/test/mock_transport/src/recorder_policy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ impl Policy for MockTransportRecorderPolicy {
let mut response_contents_stream = std::fs::File::create(&response_path).unwrap();
response_contents_stream
.write_all(response_contents.as_bytes())
.context(ErrorKind::MockFramework, "cannot write response file")?
.context(ErrorKind::MockFramework, "cannot write response file")?;
}

self.transaction.increment_number();
Expand Down
2 changes: 1 addition & 1 deletion sdk/core/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ mod tests {
#[test]
fn test_require_send_sync() {
// this won't compile if Context as a whole is not Send + Sync
require_send_sync(&Context::new())
require_send_sync(&Context::new());
}

#[test]
Expand Down
2 changes: 1 addition & 1 deletion sdk/core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ where
T: AppendToUrlQuery,
{
fn append_to_url_query(&self, url: &mut url::Url) {
(*self).append_to_url_query(url)
(*self).append_to_url_query(url);
}
}

Expand Down
2 changes: 1 addition & 1 deletion sdk/core/src/policies/retry_policies/exponential_retry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ mod tests {
assert!(
a == e || a + 1 == e || a == e + 1,
"actual != expected\nActual: {actual:?}\nExpected: {expected:?}"
)
);
}
}
}
2 changes: 1 addition & 1 deletion sdk/core/src/policies/telemetry_policy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,6 @@ mod test {
assert_eq!(
policy.header,
format!("azsdk-rust-unknown/unknown (unknown; {OS}; {ARCH})")
)
);
}
}
2 changes: 1 addition & 1 deletion sdk/data_cosmos/src/consistency_level.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ impl AsHeaders for ConsistencyLevel {
// if we have a Session consistency level we make sure to pass
// the x-ms-session-token header too.
if let ConsistencyLevel::Session(session_token) = self {
headers.push((crate::headers::HEADER_SESSION_TOKEN, session_token.into()))
headers.push((crate::headers::HEADER_SESSION_TOKEN, session_token.into()));
}

headers.into_iter()
Expand Down
2 changes: 1 addition & 1 deletion sdk/data_cosmos/src/operations/execute_stored_procedure.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ impl<T: DeserializeOwned + Send> ExecuteStoredProcedureBuilder<T> {
.stored_procedure_request(azure_core::Method::Post);

if let Some(pk) = self.partition_key.as_ref() {
crate::cosmos_entity::add_as_partition_key_header_serialized(pk, &mut request)
crate::cosmos_entity::add_as_partition_key_header_serialized(pk, &mut request);
}

if let Some(cl) = &self.consistency_level {
Expand Down
2 changes: 1 addition & 1 deletion sdk/identity/src/oauth2_http_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ impl Oauth2HttpClient {
let method = try_from_method(&oauth2_request.method)?;
let mut request = Request::new(oauth2_request.url, method);
for (name, value) in to_headers(&oauth2_request.headers) {
request.insert_header(name, value)
request.insert_header(name, value);
}
request.set_body(oauth2_request.body);
let response = self.http_client.execute_request(&request).await?;
Expand Down
2 changes: 1 addition & 1 deletion sdk/identity/src/refresh_token.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ pub async fn exchange(
.append_pair("refresh_token", refresh_token.secret());
// optionally add the client secret
if let Some(client_secret) = client_secret {
encoded = encoded.append_pair("client_secret", client_secret)
encoded = encoded.append_pair("client_secret", client_secret);
};
encoded.finish()
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ impl CertificateCredentialOptions {
}
/// Set the authority host for authentication requests.
pub fn set_authority_host(&mut self, authority_host: String) {
self.authority_host = authority_host
self.authority_host = authority_host;
}

/// The authority host to use for authentication requests. The default is
Expand All @@ -60,7 +60,7 @@ impl CertificateCredentialOptions {

/// Enable/disable sending the certificate chain
pub fn set_send_certificate_chain(&mut self, send_certificate_chain: bool) {
self.send_certificate_chain = send_certificate_chain
self.send_certificate_chain = send_certificate_chain;
}

/// Whether certificate chain is sent as part of the request or not. Default is
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ impl TokenCredentialOptions {
}
/// Set the authority host for authentication requests.
pub fn set_authority_host(&mut self, authority_host: String) {
self.authority_host = authority_host
self.authority_host = authority_host;
}

/// The authority host to use for authentication requests. The default is
Expand Down
2 changes: 1 addition & 1 deletion sdk/identity/src/token_credentials/default_credentials.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ impl DefaultAzureCredentialBuilder {
if self.include_managed_identity_credential {
sources.push(DefaultAzureCredentialEnum::ManagedIdentity(
ImdsManagedIdentityCredential::default(),
))
));
}
if self.include_azure_cli_credential {
sources.push(DefaultAzureCredentialEnum::AzureCli(
Expand Down
12 changes: 6 additions & 6 deletions sdk/iot_deviceupdate/src/device_update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ impl DeviceUpdateClient {
uri.set_query(None);
uri = uri.join(&url).with_context(ErrorKind::DataConversion, || {
format!("failed to parse url. url: {url}")
})?
})?;
}
}
}
Expand Down Expand Up @@ -344,7 +344,7 @@ impl DeviceUpdateClient {
uri.set_query(None);
uri = uri.join(&url).with_context(ErrorKind::DataConversion, || {
format!("failed to parse url. url: {url}")
})?
})?;
}
}
}
Expand Down Expand Up @@ -386,7 +386,7 @@ impl DeviceUpdateClient {
uri.set_query(None);
uri = uri.join(&url).with_context(ErrorKind::DataConversion, || {
format!("failed to parse url. url: {url}")
})?
})?;
}
}
}
Expand Down Expand Up @@ -415,7 +415,7 @@ impl DeviceUpdateClient {
uri.set_query(None);
uri = uri.join(&url).with_context(ErrorKind::DataConversion, || {
format!("failed to parse url. url: {url}")
})?
})?;
}
}
}
Expand Down Expand Up @@ -457,7 +457,7 @@ impl DeviceUpdateClient {
uri.set_query(None);
uri = uri.join(&url).with_context(ErrorKind::DataConversion, || {
format!("failed to parse url. url: {url}")
})?
})?;
}
}
}
Expand Down Expand Up @@ -498,7 +498,7 @@ impl DeviceUpdateClient {
uri.set_query(None);
uri = uri.join(&url).with_context(ErrorKind::DataConversion, || {
format!("failed to parse url. url: {url}")
})?
})?;
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion sdk/iot_hub/src/service/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -876,7 +876,7 @@ pub struct ServiceOptions {
impl ServiceOptions {
/// set timeout duration for requests
pub fn set_timeout(&mut self, default_timeout: Timeout) {
self.timeout_policy = TimeoutPolicy::new(Some(default_timeout))
self.timeout_policy = TimeoutPolicy::new(Some(default_timeout));
}
}

Expand Down
4 changes: 2 additions & 2 deletions sdk/storage/src/authorization/authorization_policy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ impl Policy for AuthorizationPolicy {
ctx.get()
.expect("ServiceType must be in the Context at this point"),
)?;
request.insert_header(AUTHORIZATION, auth)
request.insert_header(AUTHORIZATION, auth);
}
request
}
Expand Down Expand Up @@ -201,7 +201,7 @@ fn canonicalized_resource(account: &str, uri: &Url) -> String {

for (i, item) in ret.iter().enumerate() {
if i > 0 {
can_res += ","
can_res += ",";
}
can_res += item;
}
Expand Down
6 changes: 3 additions & 3 deletions sdk/storage/src/shared_access_signature/account_sas.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,13 +212,13 @@ impl SasToken for AccountSharedAccessSignature {
];

if let Some(start) = &self.start {
elements.push(format!("st={}", format_form(format_date(*start))))
elements.push(format!("st={}", format_form(format_date(*start))));
}
if let Some(ip) = &self.ip {
elements.push(format!("sip={ip}"))
elements.push(format!("sip={ip}"));
}
if let Some(protocol) = &self.protocol {
elements.push(format!("spr={protocol}"))
elements.push(format!("spr={protocol}"));
}
let sig = AccountSharedAccessSignature::signature(self);
elements.push(format!("sig={}", format_form(sig)));
Expand Down
34 changes: 17 additions & 17 deletions sdk/storage/src/shared_access_signature/service_sas.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,43 +48,43 @@ pub struct BlobSasPermissions {
impl fmt::Display for BlobSasPermissions {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
if self.read {
write!(f, "r")?
write!(f, "r")?;
};
if self.add {
write!(f, "a")?
write!(f, "a")?;
};
if self.create {
write!(f, "c")?
write!(f, "c")?;
};
if self.write {
write!(f, "w")?
write!(f, "w")?;
};
if self.delete {
write!(f, "d")?
write!(f, "d")?;
};
if self.delete_version {
write!(f, "x")?
write!(f, "x")?;
};
if self.permanent_delete {
write!(f, "y")?
write!(f, "y")?;
};
if self.list {
write!(f, "l")?
write!(f, "l")?;
};
if self.tags {
write!(f, "t")?
write!(f, "t")?;
};
if self.move_ {
write!(f, "m")?
write!(f, "m")?;
};
if self.execute {
write!(f, "e")?
write!(f, "e")?;
};
if self.ownership {
write!(f, "o")?
write!(f, "o")?;
};
if self.permissions {
write!(f, "p")?
write!(f, "p")?;
};
Ok(())
}
Expand Down Expand Up @@ -171,19 +171,19 @@ impl SasToken for BlobSharedAccessSignature {
];

if let Some(start) = &self.start {
elements.push(format!("st={}", format_form(format_date(*start))))
elements.push(format!("st={}", format_form(format_date(*start))));
}

if let Some(ip) = &self.ip {
elements.push(format!("sip={ip}"))
elements.push(format!("sip={ip}"));
}

if let Some(protocol) = &self.protocol {
elements.push(format!("spr={protocol}"))
elements.push(format!("spr={protocol}"));
}

if let Some(signed_directory_depth) = &self.signed_directory_depth {
elements.push(format!("sdd={signed_directory_depth}"))
elements.push(format!("sdd={signed_directory_depth}"));
}

let sig = self.sign();
Expand Down
2 changes: 1 addition & 1 deletion sdk/storage_datalake/src/operations/path_patch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ impl<C: PathClient + 'static> PatchPathBuilder<C> {
if let Some(bytes) = self.bytes {
request.insert_headers(&ContentLength::new(bytes.len() as i32));
request.insert_headers(&ContentType::new("application/octet-stream"));
request.set_body(bytes)
request.set_body(bytes);
} else {
request.insert_headers(&ContentLength::new(0));
}
Expand Down

0 comments on commit d8073da

Please sign in to comment.