Skip to content

Commit d1b90b9

Browse files
authored
cleanup: resolve a few Rust warnings (#907)
1 parent a314752 commit d1b90b9

File tree

3 files changed

+1
-40
lines changed

3 files changed

+1
-40
lines changed

src/base/spec.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,6 @@ pub trait SpecFormatter {
1818
fn format(&self, mode: OutputMode) -> String;
1919
}
2020

21-
#[derive(Debug, Clone, Serialize, Deserialize)]
22-
#[serde(tag = "kind")]
23-
pub enum SpecString {
24-
/// The value comes from the environment variable.
25-
Env(String),
26-
/// The value is defined by the literal string.
27-
#[serde(untagged)]
28-
Literal(String),
29-
}
30-
3121
pub type ScopeName = String;
3222

3323
/// Used to identify a data field within a flow.

src/lib_context.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ impl FlowContext {
122122

123123
pub async fn use_execution_ctx(
124124
&self,
125-
) -> Result<tokio::sync::RwLockReadGuard<FlowExecutionContext>> {
125+
) -> Result<tokio::sync::RwLockReadGuard<'_, FlowExecutionContext>> {
126126
let execution_ctx = self.execution_ctx.read().await;
127127
if !execution_ctx.setup_change.is_up_to_date() {
128128
api_bail!(

src/utils/db.rs

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,3 @@
1-
#[derive(Debug, Clone, PartialEq, Eq)]
2-
pub struct ValidIdentifier(pub String);
3-
4-
impl TryFrom<String> for ValidIdentifier {
5-
type Error = anyhow::Error;
6-
7-
fn try_from(s: String) -> Result<Self, Self::Error> {
8-
if !s.is_empty() && s.chars().all(|c| c.is_alphanumeric() || c == '_') {
9-
Ok(ValidIdentifier(s))
10-
} else {
11-
Err(anyhow::anyhow!("Invalid identifier: {s:?}"))
12-
}
13-
}
14-
}
15-
16-
impl std::fmt::Display for ValidIdentifier {
17-
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
18-
std::fmt::Display::fmt(&self.0, f)
19-
}
20-
}
21-
22-
impl std::ops::Deref for ValidIdentifier {
23-
type Target = String;
24-
25-
fn deref(&self) -> &Self::Target {
26-
&self.0
27-
}
28-
}
29-
301
pub enum WriteAction {
312
Insert,
323
Update,

0 commit comments

Comments
 (0)