chore: fix rust lint
This commit is contained in:
parent
2ba3aaba47
commit
5fe2be031f
@ -26,7 +26,7 @@ macro_rules! draft_define {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn draft(&self) -> MappedMutexGuard<$id> {
|
pub fn draft(&self) -> MappedMutexGuard<$id> {
|
||||||
MutexGuard::map(self.inner.lock(), |mut inner| {
|
MutexGuard::map(self.inner.lock(), |inner| {
|
||||||
if inner.1.is_none() {
|
if inner.1.is_none() {
|
||||||
inner.1 = Some(inner.0.clone());
|
inner.1 = Some(inner.0.clone());
|
||||||
}
|
}
|
||||||
|
@ -38,7 +38,7 @@ impl IProfiles {
|
|||||||
}
|
}
|
||||||
// compatible with the old old old version
|
// compatible with the old old old version
|
||||||
profiles.items.as_mut().map(|items| {
|
profiles.items.as_mut().map(|items| {
|
||||||
for mut item in items.iter_mut() {
|
for item in items.iter_mut() {
|
||||||
if item.uid.is_none() {
|
if item.uid.is_none() {
|
||||||
item.uid = Some(help::get_uid("d"));
|
item.uid = Some(help::get_uid("d"));
|
||||||
}
|
}
|
||||||
@ -155,7 +155,7 @@ impl IProfiles {
|
|||||||
pub fn patch_item(&mut self, uid: String, item: PrfItem) -> Result<()> {
|
pub fn patch_item(&mut self, uid: String, item: PrfItem) -> Result<()> {
|
||||||
let mut items = self.items.take().unwrap_or(vec![]);
|
let mut items = self.items.take().unwrap_or(vec![]);
|
||||||
|
|
||||||
for mut each in items.iter_mut() {
|
for each in items.iter_mut() {
|
||||||
if each.uid == Some(uid.clone()) {
|
if each.uid == Some(uid.clone()) {
|
||||||
patch!(each, item, itype);
|
patch!(each, item, itype);
|
||||||
patch!(each, item, name);
|
patch!(each, item, name);
|
||||||
@ -189,7 +189,7 @@ impl IProfiles {
|
|||||||
if let Some(items) = self.items.as_mut() {
|
if let Some(items) = self.items.as_mut() {
|
||||||
let some_uid = Some(uid.clone());
|
let some_uid = Some(uid.clone());
|
||||||
|
|
||||||
for mut each in items.iter_mut() {
|
for each in items.iter_mut() {
|
||||||
if each.uid == some_uid {
|
if each.uid == some_uid {
|
||||||
each.extra = item.extra;
|
each.extra = item.extra;
|
||||||
each.updated = item.updated;
|
each.updated = item.updated;
|
||||||
|
Loading…
Reference in New Issue
Block a user