Fix lints/errors when compiling specific feature combos

- Building with sqlite3 non-bundled may result in compile-time error if
  the system version is not new enough; the bindgen feature must be
  enabled to create ffi bindings from the system version.
- Some unused code warnings show up if some features are disabled,
  refactor code to make them go away.
- Update libloading to 0.8 to prevent dual dependencies in
  Cargo.lock (rusqlite's bundled feature requires it)

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
pull/439/head
Manos Pitsidianakis 2 months ago
parent 475860c946
commit 073aef8671
No known key found for this signature in database
GPG Key ID: 7729C7707F7E09D0

6
Cargo.lock generated

@ -1182,12 +1182,12 @@ dependencies = [
[[package]]
name = "libloading"
version = "0.7.4"
version = "0.8.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f"
checksum = "e310b3a6b5907f99202fcdb4960ff45b93735d7c7d96b760fcff8db2dc0e103d"
dependencies = [
"cfg-if",
"winapi",
"windows-targets 0.48.5",
]
[[package]]

@ -53,8 +53,9 @@ impl Account {
Ok(job_id)
}
#[cfg(not(feature = "sqlite3"))]
pub(super) fn update_cached_env(&mut self, _: Envelope, _: Option<EnvelopeHash>) {}
// #[cfg(not(feature = "sqlite3"))]
// pub(super) fn update_cached_env(&mut self, _: Envelope, _:
// Option<EnvelopeHash>) {}
#[cfg(feature = "sqlite3")]
pub(super) fn update_cached_env(&mut self, env: Envelope, old_hash: Option<EnvelopeHash>) {

@ -386,6 +386,7 @@ impl ViewFilter {
{
#[cfg(not(feature = "gpgme"))]
{
_ = parts;
return Ok(Self {
filter_invocation: String::new(),
content_type: att.content_type.clone(),

@ -19,17 +19,19 @@
* along with meli. If not, see <http://www.gnu.org/licenses/>.
*/
#[cfg(feature = "cli-docs")]
use std::io::prelude::*;
use std::{
io::prelude::*,
path::PathBuf,
process::{Command, Stdio},
};
use crossbeam::channel::{Receiver, Sender};
use melib::{Result, ShellExpandTrait};
use melib::{utils::futures::timeout, Result, ShellExpandTrait};
use crate::{args::PathOrStdio, *};
use crate::{
args::{PathOrStdio, ToolOpt},
*,
};
pub fn create_config(path: Option<PathOrStdio>) -> Result<()> {
let config_path = match path {
@ -175,11 +177,7 @@ pub fn view(
Ok(state)
}
pub fn tool(path: Option<PathBuf>, opt: args::ToolOpt) -> Result<()> {
use melib::utils::futures::timeout;
use crate::{args::ToolOpt, conf::composing::SendMail};
pub fn tool(path: Option<PathBuf>, opt: ToolOpt) -> Result<()> {
let config_path = if let Some(path) = path {
path.expand()
} else {
@ -208,6 +206,8 @@ pub fn tool(path: Option<PathBuf>, opt: args::ToolOpt) -> Result<()> {
match opt {
#[cfg(feature = "smtp")]
ToolOpt::SmtpShell { .. } => {
use crate::conf::composing::SendMail;
let send_mail = file_account_conf
.conf_override
.composing

@ -34,7 +34,7 @@ indexmap = { version = "^1.5", default-features = false, features = ["serde-1"]
isahc = { version = "^1.7.2", optional = true, default-features = false, features = ["http2", "json", "text-decoding"] }
libc = { version = "0.2.125", features = ["extra_traits"] }
libloading = "^0.7"
libloading = "^0.8"
log = { version = "0.4", features = ["std"] }
native-tls = { version = "0.2.3", default-features = false, optional = true }
nix = { version = "0.27", default-features = false, features = ["fs", "socket", "dir", "hostname"] }
@ -73,8 +73,8 @@ mbox = ["notify"]
notmuch = ["notify"]
smtp = ["tls", "base64"]
smtp-trace = ["smtp"]
sqlite3 = ["rusqlite"]
sqlite3-static = ["sqlite3", "rusqlite/bundled-full"]
sqlite3 = ["sqlite3-static"]
sqlite3-static = ["rusqlite", "rusqlite/bundled-full"]
tls = ["native-tls"]
tls-static = ["tls", "native-tls/vendored"]
vcard = []

Loading…
Cancel
Save