Skip to content

Commit 3cab13b

Browse files
committed
Applying patch from closed PR 6102 and re-opening to clean up commits ignoring warnings
1 parent 84464c5 commit 3cab13b

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

clarity/src/vm/analysis/mod.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,16 @@ use self::trait_checker::TraitChecker;
3434
use self::type_checker::v2_05::TypeChecker as TypeChecker2_05;
3535
use self::type_checker::v2_1::TypeChecker as TypeChecker2_1;
3636
pub use self::types::{AnalysisPass, ContractAnalysis};
37+
#[cfg(feature = "rusqlite")]
3738
use crate::vm::ast::{build_ast_with_rules, ASTRules};
3839
use crate::vm::costs::LimitedCostTracker;
3940
#[cfg(feature = "rusqlite")]
4041
use crate::vm::database::MemoryBackingStore;
4142
use crate::vm::database::STORE_CONTRACT_SRC_INTERFACE;
4243
use crate::vm::representations::SymbolicExpression;
43-
use crate::vm::types::{QualifiedContractIdentifier, TypeSignature};
44+
#[cfg(feature = "rusqlite")]
45+
use crate::vm::types::TypeSignature;
46+
use crate::vm::types::QualifiedContractIdentifier;
4447
use crate::vm::ClarityVersion;
4548

4649
/// Used by CLI tools like the docs generator. Not used in production

clarity/src/vm/docs/contracts.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,11 @@ use hashbrown::{HashMap, HashSet};
44
use stacks_common::consts::CHAIN_ID_TESTNET;
55
use stacks_common::types::StacksEpochId;
66

7-
#[cfg(feature = "rusqlite")]
87
use crate::vm::analysis::mem_type_check;
98
use crate::vm::analysis::ContractAnalysis;
109
use crate::vm::ast::{build_ast_with_rules, ASTRules};
1110
use crate::vm::contexts::GlobalContext;
1211
use crate::vm::costs::LimitedCostTracker;
13-
#[cfg(feature = "rusqlite")]
1412
use crate::vm::database::MemoryBackingStore;
1513
use crate::vm::docs::{get_input_type_string, get_output_type_string, get_signature};
1614
use crate::vm::types::{FunctionType, QualifiedContractIdentifier, Value};
@@ -63,7 +61,6 @@ fn make_func_ref(func_name: &str, func_type: &FunctionType, description: &str) -
6361
}
6462
}
6563

66-
#[cfg(feature = "rusqlite")]
6764
#[allow(clippy::expect_used)]
6865
fn get_constant_value(var_name: &str, contract_content: &str) -> Value {
6966
let to_eval = format!("{}\n{}", contract_content, var_name);
@@ -72,7 +69,6 @@ fn get_constant_value(var_name: &str, contract_content: &str) -> Value {
7269
.expect("BUG: failed to return constant value")
7370
}
7471

75-
#[cfg(feature = "rusqlite")]
7672
fn doc_execute(program: &str) -> Result<Option<Value>, vm::Error> {
7773
let contract_id = QualifiedContractIdentifier::transient();
7874
let mut contract_context = ContractContext::new(contract_id.clone(), ClarityVersion::Clarity2);
@@ -99,7 +95,6 @@ fn doc_execute(program: &str) -> Result<Option<Value>, vm::Error> {
9995
})
10096
}
10197

102-
#[cfg(feature = "rusqlite")]
10398
#[allow(clippy::expect_used)]
10499
pub fn make_docs(
105100
content: &str,
@@ -185,7 +180,6 @@ pub fn make_docs(
185180

186181
/// Produce a set of documents for multiple contracts, supplied as a list of `(contract_name, contract_content)` pairs,
187182
/// and a map from `contract_name` to corresponding `ContractSupportDocs`
188-
#[cfg(feature = "rusqlite")]
189183
pub fn produce_docs_refs<A: AsRef<str>, B: AsRef<str>>(
190184
contracts: &[(A, B)],
191185
support_docs: &HashMap<&str, ContractSupportDocs>,

clarity/src/vm/docs/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ use crate::vm::types::{FixedFunction, FunctionType};
2323
use crate::vm::variables::NativeVariables;
2424
use crate::vm::ClarityVersion;
2525

26+
#[cfg(feature = "rusqlite")]
2627
pub mod contracts;
2728

2829
#[derive(Serialize)]

0 commit comments

Comments
 (0)