Merge pull request #282 from taskchampion/issue281

Fix clippy and only run it with the MSRV
This commit is contained in:
Dustin J. Mitchell
2021-09-06 10:12:39 -04:00
committed by GitHub
7 changed files with 18 additions and 10 deletions

View File

@@ -27,6 +27,13 @@ jobs:
path: target
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
- uses: actions-rs/toolchain@v1
with:
# Fixed version for clippy lints. Bump this as necesary. It must not
# be older than the MSRV in tests.yml.
toolchain: "1.54"
override: true
- uses: actions-rs/cargo@v1.0.1
with:
command: check

View File

@@ -12,7 +12,8 @@ jobs:
strategy:
matrix:
rust:
- "1.47" # MSRV
# MSRV; most not be higher than the clippy rust version in checks.yml
- "1.47"
- "stable"
os:
- ubuntu-latest

View File

@@ -125,7 +125,7 @@ fn get_server(settings: &Settings) -> anyhow::Result<Box<dyn Server>> {
settings.server_origin.as_ref(),
settings.encryption_secret.as_ref(),
) {
let client_key = Uuid::parse_str(&client_key)?;
let client_key = Uuid::parse_str(client_key)?;
log::debug!("Using sync-server with origin {}", origin);
log::debug!("Sync client ID: {}", client_key);

View File

@@ -30,11 +30,11 @@ pub(super) fn apply_modification(
}
for tag in modification.add_tags.iter() {
task.add_tag(&tag)?;
task.add_tag(tag)?;
}
for tag in modification.remove_tags.iter() {
task.remove_tag(&tag)?;
task.remove_tag(tag)?;
}
if let Some(wait) = modification.wait {

View File

@@ -130,7 +130,7 @@ impl TryFrom<&toml::Value> for Report {
.map(|(i, v)| {
v.as_str()
.ok_or_else(|| anyhow!(".filter[{}]: not a string", i))
.and_then(|s| Condition::parse_str(&s))
.and_then(|s| Condition::parse_str(s))
.map_err(|e| anyhow!(".filter[{}]: {}", i, e))
})
.collect::<Result<Vec<_>>>()?,

View File

@@ -97,7 +97,7 @@ impl Settings {
"server_dir",
"reports",
];
let table = table_with_keys(&config_toml, &table_keys)?;
let table = table_with_keys(config_toml, &table_keys)?;
fn get_str_cfg<F: FnOnce(String)>(
table: &Table,

View File

@@ -86,7 +86,7 @@ impl<'t> StorageTxn for Txn<'t> {
let bucket = self.clients_bucket();
let kvtxn = self.kvtxn();
let client = match kvtxn.get(&bucket, key) {
let client = match kvtxn.get(bucket, key) {
Ok(buf) => buf,
Err(Error::NotFound) => return Ok(None),
Err(e) => return Err(e.into()),
@@ -101,7 +101,7 @@ impl<'t> StorageTxn for Txn<'t> {
let bucket = self.clients_bucket();
let kvtxn = self.kvtxn();
let client = Client { latest_version_id };
kvtxn.set(&bucket, key, Msgpack::to_value_buf(client)?)?;
kvtxn.set(bucket, key, Msgpack::to_value_buf(client)?)?;
Ok(())
}
@@ -122,7 +122,7 @@ impl<'t> StorageTxn for Txn<'t> {
let key = version_db_key(client_key, parent_version_id);
let bucket = self.versions_bucket();
let kvtxn = self.kvtxn();
let version = match kvtxn.get(&bucket, key) {
let version = match kvtxn.get(bucket, key) {
Ok(buf) => buf,
Err(Error::NotFound) => return Ok(None),
Err(e) => return Err(e.into()),
@@ -147,7 +147,7 @@ impl<'t> StorageTxn for Txn<'t> {
parent_version_id,
history_segment,
};
kvtxn.set(&bucket, key, Msgpack::to_value_buf(version)?)?;
kvtxn.set(bucket, key, Msgpack::to_value_buf(version)?)?;
Ok(())
}