File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -74,10 +74,10 @@ struct NoteData {
74
74
}
75
75
76
76
impl NoteData {
77
- pub ( crate ) fn get_url_from_title ( & self , title : & str ) -> Option < String > {
77
+ pub ( crate ) fn get_url_from_title_prefix ( & self , title : & str ) -> Option < String > {
78
78
let tmp = self . entries_by_url . clone ( ) ;
79
79
tmp. iter ( ) . sorted ( ) . find_map ( |( key, val) | {
80
- if val. title == title {
80
+ if val. title . starts_with ( title) {
81
81
Some ( key. to_owned ( ) )
82
82
} else {
83
83
None
@@ -86,7 +86,7 @@ impl NoteData {
86
86
}
87
87
88
88
pub ( crate ) fn remove_by_title ( & mut self , title : & str ) -> Option < NoteDataEntry > {
89
- if let Some ( url_to_remove) = self . get_url_from_title ( title) {
89
+ if let Some ( url_to_remove) = self . get_url_from_title_prefix ( title) {
90
90
if let Some ( entry) = self . entries_by_url . remove ( & url_to_remove) {
91
91
log:: debug!( "SUCCESSFULLY REMOVED ENTRY: {:#?}" , & entry) ;
92
92
Some ( entry)
You can’t perform that action at this time.
0 commit comments