Skip to content

Commit 455471e

Browse files
committed
Fix lints
1 parent b95ea2a commit 455471e

9 files changed

Lines changed: 14 additions & 15 deletions

File tree

‎extensions/scarb-doc/src/docs_generation/markdown/context.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ impl Formatting for MarkdownFormatting {
9595
let group_path = format!(
9696
"[{}](./{}{})",
9797
group_name,
98-
&group_name.replace(" ", "_"),
98+
group_name.replace(" ", "_"),
9999
OutputFilesExtension::Md.get_string()
100100
);
101101
format!("Part of the group: {group_path}\n")
@@ -220,7 +220,7 @@ fn format_signature(
220220
.iter()
221221
.find(|&link| i >= link.start && i < link.end)
222222
{
223-
if index_map.contains_key(&format!("./{}{files_extension}", &link.full_path)) {
223+
if index_map.contains_key(&format!("./{}{files_extension}", link.full_path)) {
224224
let slice = escape_html(&input[link.start..link.end]);
225225
escaped.push_str(&format!(
226226
"<a href=\"{}.html\">{}</a>",

‎extensions/scarb-doc/src/docs_generation/markdown/traits.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -868,7 +868,7 @@ fn get_linked_path(full_path: &str, files_extension: &str) -> String {
868868
current_path.push('-');
869869
}
870870
current_path.push_str(element);
871-
let formatted = format!("[{element}](./{}{files_extension})", &current_path,);
871+
let formatted = format!("[{element}](./{}{files_extension})", current_path,);
872872
result.push(formatted);
873873
}
874874
result.join("::")
@@ -896,7 +896,7 @@ fn get_full_subitem_path<T: MarkdownDocItem + SubPathDocItem>(
896896
format!(
897897
"{}::[{}](./{})",
898898
get_linked_path(parent_path, files_extension),
899-
&item_path,
899+
item_path,
900900
last_path
901901
)
902902
} else {

‎extensions/scarb-doc/src/types/groups.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ pub struct Group<'db> {
2626

2727
impl<'db> Group<'db> {
2828
pub fn filename(&self, files_extension: &str) -> String {
29-
format!("{}{files_extension}", &self.get_name_normalized())
29+
format!("{}{files_extension}", self.get_name_normalized())
3030
}
3131
pub fn get_name_normalized(&self) -> String {
3232
self.name.replace(" ", "_")

‎scarb/src/compiler/compilers/starknet_contract/compiler.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ pub fn find_project_contracts<'db>(
297297
contract_path.replace(&exported_module_path, "");
298298
let exported_contract_path = format!(
299299
"{}::{exported_module_name}{exported_contract_path}",
300-
&module_with_reexport
300+
module_with_reexport
301301
);
302302
let selectors_used = external_contracts
303303
.iter()

‎scarb/src/compiler/plugin/proc_macro/v2/host/conversion.rs‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,9 @@ pub fn find_encompassing_node<'db>(
9292

9393
let mut current_node = root_syntax_node.lookup_offset(db, start_offset);
9494
while current_node.span(db).end < end_offset {
95-
if let Some(parent) = current_node.parent(db) {
95+
{
96+
let parent = current_node.parent(db)?;
9697
current_node = parent;
97-
} else {
98-
return None;
9998
}
10099
}
101100
Some(current_node)

‎scarb/src/core/registry/client/http.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ impl RegistryClient for HttpRegistryClient<'_> {
171171
let index_config = self.index_config.load().await?;
172172

173173
let file_part = Part::stream(Body::from(file.try_clone().await?))
174-
.file_name(format!("{}_{}", &package.id.name, &package.id.version));
174+
.file_name(format!("{}_{}", package.id.name, package.id.version));
175175
let form = Form::new().part("file", file_part);
176176

177177
let response = self

‎scarb/src/ops/publish.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ pub fn publish(package_id: PackageId, opts: &PublishOpts, ws: &Workspace<'_>) ->
5757
Ok(RegistryUpload::Success) => {
5858
ws.config().ui().print(Status::new(
5959
"Published",
60-
format!("{}", &dest_package_id).as_str(),
60+
format!("{}", dest_package_id).as_str(),
6161
));
6262
Ok(())
6363
}

‎scarb/src/ops/resolve.rs‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,9 @@ impl WorkspaceResolve {
124124
let Some(pid) = deps.iter().find(|p| p.name == *package_name) else {
125125
bail!(
126126
"feature `{feature}` of package `{}` depends on feature `{}` from package `{package_name}`, which is not a dependency of `{}`",
127-
&package_id.name,
128-
&dependant.feature,
129-
&package_id.name
127+
package_id.name,
128+
dependant.feature,
129+
package_id.name
130130
);
131131
};
132132
*pid

‎utils/scarb-build-metadata/build.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ fn find_corelib_local_path(compiler_package: &Package) -> Option<Utf8PathBuf> {
118118
// Corelib should be present in Cairo compiler repository root.
119119
.map(|p| p.join("corelib"))
120120
// Ensure path exists
121-
.and_then(|p| if p.exists() { Some(p) } else { None })
121+
.filter(|p| p.exists())
122122
// Note, that for registry source, we do not get whole Cairo repository in cache.
123123
// Thus the corelib will not be found - only the crate is downloaded.
124124
}

0 commit comments

Comments
 (0)