Browse Source

Fewer warnings

github_actions
daladim 5 years ago
parent
commit
4eb1ae2fb1
  1. 3
      src/bin/dummy.rs
  2. 4
      src/calendar/cached_calendar.rs
  3. 7
      src/calendar/mod.rs
  4. 5
      src/client.rs
  5. 3
      src/provider.rs
  6. 1
      src/traits.rs
  7. 4
      tests/sync.rs

3
src/bin/dummy.rs

@ -1,3 +1,4 @@
/*
use std::path::Path;
use my_tasks::{client::Client, traits::CalDavSource};
@ -7,8 +8,8 @@ use my_tasks::settings::URL;
use my_tasks::settings::USERNAME;
use my_tasks::settings::PASSWORD;
const CACHE_FILE: &str = "caldav_cache.json";
*/
#[tokio::main]
async fn main() {

4
src/calendar/cached_calendar.rs

@ -1,5 +1,3 @@
use std::convert::TryFrom;
use std::error::Error;
use std::collections::HashMap;
use std::collections::BTreeMap;
@ -103,7 +101,7 @@ impl PartialCalendar for CachedCalendar {
return None;
}
fn find_missing_items_compared_to(&self, other: &dyn PartialCalendar) -> Vec<ItemId> {
fn find_missing_items_compared_to(&self, _other: &dyn PartialCalendar) -> Vec<ItemId> {
unimplemented!("todo");
}
}

7
src/calendar/mod.rs

@ -2,15 +2,8 @@ pub mod cached_calendar;
use std::convert::TryFrom;
use std::error::Error;
use std::collections::HashMap;
use std::collections::BTreeMap;
use url::Url;
use serde::{Deserialize, Serialize};
use chrono::{DateTime, Utc};
use crate::Item;
use crate::item::ItemId;
use bitflags::bitflags;

5
src/client.rs

@ -2,18 +2,15 @@
use std::error::Error;
use std::convert::TryFrom;
use std::sync::Mutex;
use reqwest::Method;
use reqwest::header::CONTENT_TYPE;
use minidom::Element;
use url::Url;
use async_trait::async_trait;
use crate::utils::{find_elem, find_elems};
use crate::calendar::cached_calendar::CachedCalendar;
use crate::traits::PartialCalendar;
use crate::traits::CalDavSource;
static DAVCLIENT_BODY: &str = r#"
@ -237,7 +234,7 @@ impl Client {
let el: Element = text.parse().unwrap();
let responses = find_elems(&el, "response");
for response in responses {
for _response in responses {
println!("(a response)\n");
}

3
src/provider.rs

@ -7,7 +7,6 @@ use chrono::{DateTime, Utc};
use crate::traits::{CalDavSource, CompleteCalendar};
use crate::traits::SyncSlave;
use crate::traits::PartialCalendar;
use crate::calendar::cached_calendar::CachedCalendar;
use crate::Item;
use crate::item::ItemId;
@ -74,7 +73,7 @@ where
let server_mod = cal_server.get_items_modified_since(last_sync, None);
let server_del = match last_sync {
Some(date) => cal_server.find_missing_items_compared_to(cal_local),
Some(_date) => cal_server.find_missing_items_compared_to(cal_local),
None => Vec::new(),
};
let local_del = match last_sync {

1
src/traits.rs

@ -5,7 +5,6 @@ use async_trait::async_trait;
use url::Url;
use chrono::{DateTime, Utc};
use crate::calendar::cached_calendar::CachedCalendar;
use crate::item::Item;
use crate::item::ItemId;

4
tests/sync.rs

@ -4,7 +4,7 @@ use chrono::{Utc, TimeZone};
use url::Url;
use my_tasks::traits::CalDavSource;
use my_tasks::traits::{PartialCalendar, CompleteCalendar};
use my_tasks::traits::PartialCalendar;
use my_tasks::cache::Cache;
use my_tasks::Item;
use my_tasks::Task;
@ -76,8 +76,6 @@ async fn populate_test_provider() -> Provider<Cache, CachedCalendar, Cache, Cach
let task_i_id = task_i.id().clone();
let task_j_id = task_j.id().clone();
let task_k_id = task_k.id().clone();
let task_l_id = task_l.id().clone();
let task_m_id = task_m.id().clone();
// Step 1
// Build the calendar as it was at the time of the sync

Loading…
Cancel
Save