Skip to content

Commit

Permalink
clippy time
Browse files Browse the repository at this point in the history
  • Loading branch information
morgante committed Aug 15, 2024
1 parent 9fd91e5 commit 14e492e
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
4 changes: 1 addition & 3 deletions crates/cli/src/updater.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use log::info;
use marzano_auth::info::AuthInfo;
use marzano_gritmodule::config::REPO_CONFIG_DIR_NAME;
use marzano_util::runtime::{ExecutionContext, LanguageModelAPI};
use reqwest::redirect::Policy;

use serde::Deserialize;
use serde::Serialize;
use std::collections::HashMap;
Expand All @@ -23,7 +23,6 @@ use tokio::io::{AsyncReadExt, AsyncWriteExt};
use tokio::sync::Mutex;
use uuid::Uuid;

use crate::utils::{get_client_arch, get_client_os};
use marzano_auth::env::{get_env_auth, get_grit_api_url};

#[derive(Debug, Serialize, Deserialize, Clone)]
Expand Down Expand Up @@ -641,7 +640,6 @@ fn release_details_relative_url(release: &str) -> String {

#[cfg(test)]
mod tests {
use fs_err::create_dir_all;

use anyhow::Result;
use chrono::NaiveDate;
Expand Down
13 changes: 7 additions & 6 deletions crates/core/src/foreign_function_definition.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,16 +110,17 @@ impl FunctionDefinition<MarzanoQueryContext> for ForeignFunctionDefinition {
})?;

#[cfg(feature = "external_functions")]
let result = function.call(&resolved_str).map_err(|e| GritPatternError::new(format!(
"failed to call function {}: {}",
self.name, e
)))?;
let result = function.call(&resolved_str).map_err(|e| {
GritPatternError::new(format!("failed to call function {}: {}", self.name, e))
})?;
// END embedded version

let string = String::from_utf8(result).map_err(|_| GritPatternError::new(format!(
let string = String::from_utf8(result).map_err(|_| {
GritPatternError::new(format!(
"function {} returned did not return a UTF-8 string",
self.name,
)))?;
))
})?;

Ok(FuncEvaluation {
predicator: true,
Expand Down
8 changes: 3 additions & 5 deletions crates/core/src/marzano_resolved_pattern.rs
Original file line number Diff line number Diff line change
Expand Up @@ -696,11 +696,9 @@ impl<'a> ResolvedPattern<'a, MarzanoQueryContext> for MarzanoResolvedPattern<'a>
)
.into()),
// unsure if this is correct, taken from text
Self::Files(_files) => {
Err(GritPatternError::new(
"cannot linearize files pattern, not implemented yet",
))
}
Self::Files(_files) => Err(GritPatternError::new(
"cannot linearize files pattern, not implemented yet",
)),
// unsure if this is correct, taken from text
Self::Constant(c) => Ok(c.to_string().into()),
}
Expand Down
5 changes: 4 additions & 1 deletion crates/grit-pattern-matcher/src/pattern/not.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ use super::{
};
use crate::context::QueryContext;
use core::fmt::Debug;
use grit_util::{error::{GritPatternError, GritResult}, AnalysisLogs};
use grit_util::{
error::{GritPatternError, GritResult},
AnalysisLogs,
};

#[derive(Debug, Clone)]
pub struct Not<Q: QueryContext> {
Expand Down

0 comments on commit 14e492e

Please sign in to comment.