Replaced ...View by &...
This commit is contained in:
parent
58b96a89b0
commit
0cf441475d
2 changed files with 26 additions and 37 deletions
|
@ -1,24 +1,21 @@
|
|||
use crate::data::TaskView;
|
||||
|
||||
/// A Caldav Calendar
|
||||
pub struct Calendar {
|
||||
name: String,
|
||||
|
||||
tasks: Vec<TaskView>,
|
||||
}
|
||||
|
||||
impl Calendar {
|
||||
pub fn name() -> String {
|
||||
self.name
|
||||
}
|
||||
|
||||
pub fn tasks() -> Vec<TaskView> {
|
||||
self.tasks
|
||||
}
|
||||
}
|
||||
|
||||
impl Drop for Calendar {
|
||||
fn drop(&mut self) {
|
||||
// TODO: display a warning in case some TaskViews still have a refcount > 0
|
||||
}
|
||||
}
|
||||
use crate::data::Task;
|
||||
|
||||
/// A Caldav Calendar
|
||||
pub struct Calendar {
|
||||
name: String,
|
||||
|
||||
tasks: Vec<Task>,
|
||||
}
|
||||
|
||||
impl Calendar {
|
||||
pub fn name(&self) -> String {
|
||||
self.name
|
||||
}
|
||||
|
||||
pub fn tasks(&self) -> Vec<&Task> {
|
||||
self.tasks
|
||||
.iter()
|
||||
.map(|t| &t)
|
||||
.collect()
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue