Skip to content

Commit

Permalink
Revert "Use CrateSettings instead of SingleCrateConfig (#982)"
Browse files Browse the repository at this point in the history
This reverts commit dc2e88b.
  • Loading branch information
maciektr committed Dec 6, 2023
1 parent 7752e07 commit 2cb0ba5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ petgraph = "0.6"
predicates = "3"
proc-macro2 = "1"
quote = "1"
rayon = "1.8"
redb = "1.4"
rayon = "1.8"
reqwest = { version = "0.11", features = ["gzip", "brotli", "deflate", "json", "stream"], default-features = false }
semver = { version = "1", features = ["serde"] }
serde = { version = "1", features = ["serde_derive"] }
Expand Down
9 changes: 4 additions & 5 deletions extensions/scarb-snforge-test-collector/src/metadata.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use anyhow::{anyhow, Context, Result};
use cairo_lang_filesystem::db::{CrateSettings, Edition};
use cairo_lang_project::AllCratesConfig;
use cairo_lang_filesystem::db::Edition;
use cairo_lang_project::{AllCratesConfig, SingleCrateConfig};
use cairo_lang_utils::ordered_hash_map::OrderedHashMap;
use camino::{Utf8Path, Utf8PathBuf};
use scarb_metadata::{CompilationUnitMetadata, Metadata, PackageMetadata};
Expand Down Expand Up @@ -71,14 +71,14 @@ impl CompilationUnit<'_> {
}

pub fn crates_config_for_compilation_unit(&self) -> AllCratesConfig {
let crates_config: OrderedHashMap<SmolStr, CrateSettings> = self
let crates_config: OrderedHashMap<SmolStr, SingleCrateConfig> = self
.unit_metadata
.components
.iter()
.map(|component| {
(
SmolStr::from(&component.name),
CrateSettings {
SingleCrateConfig {
edition: if let Some(edition) = self
.metadata
.get_package(&component.package)
Expand All @@ -93,7 +93,6 @@ impl CompilationUnit<'_> {
} else {
Edition::default()
},
experimental_features: Default::default(),
},
)
})
Expand Down
11 changes: 6 additions & 5 deletions scarb/src/compiler/db.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
use anyhow::{anyhow, Result};
use cairo_lang_compiler::db::RootDatabase;
use cairo_lang_compiler::project::{AllCratesConfig, ProjectConfig, ProjectConfigContent};
use cairo_lang_compiler::project::{
AllCratesConfig, ProjectConfig, ProjectConfigContent, SingleCrateConfig,
};
use cairo_lang_defs::db::DefsGroup;
use cairo_lang_defs::ids::ModuleId;
use cairo_lang_defs::plugin::MacroPlugin;
use cairo_lang_filesystem::db::{AsFilesGroupMut, CrateSettings, FilesGroup, FilesGroupEx};
use cairo_lang_filesystem::db::{AsFilesGroupMut, FilesGroup, FilesGroupEx};
use cairo_lang_filesystem::ids::{CrateLongId, Directory};
use cairo_lang_utils::ordered_hash_map::OrderedHashMap;
use smol_str::SmolStr;
Expand Down Expand Up @@ -89,15 +91,14 @@ fn build_project_config(unit: &CompilationUnit) -> Result<ProjectConfig> {
})
.collect();

let crates_config: OrderedHashMap<SmolStr, CrateSettings> = unit
let crates_config: OrderedHashMap<SmolStr, SingleCrateConfig> = unit
.components
.iter()
.map(|component| {
(
component.cairo_package_name(),
CrateSettings {
SingleCrateConfig {
edition: component.package.manifest.edition,
experimental_features: Default::default(),
},
)
})
Expand Down

0 comments on commit 2cb0ba5

Please sign in to comment.