mirror of
https://github.com/ankitects/anki.git
synced 2025-09-21 07:22:23 -04:00
Make some methods/fields public
This commit is contained in:
parent
96a606d78c
commit
d9d36078f1
3 changed files with 4 additions and 4 deletions
|
@ -132,7 +132,7 @@ pub struct CollectionState {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct Collection {
|
pub struct Collection {
|
||||||
pub(crate) storage: SqliteStorage,
|
pub storage: SqliteStorage,
|
||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
pub(crate) col_path: PathBuf,
|
pub(crate) col_path: PathBuf,
|
||||||
pub(crate) media_folder: PathBuf,
|
pub(crate) media_folder: PathBuf,
|
||||||
|
|
|
@ -158,7 +158,7 @@ impl Collection {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Collection {
|
impl Collection {
|
||||||
pub(crate) fn get_deck(&mut self, did: DeckId) -> Result<Option<Arc<Deck>>> {
|
pub fn get_deck(&mut self, did: DeckId) -> Result<Option<Arc<Deck>>> {
|
||||||
if let Some(deck) = self.state.deck_cache.get(&did) {
|
if let Some(deck) = self.state.deck_cache.get(&did) {
|
||||||
return Ok(Some(deck.clone()));
|
return Ok(Some(deck.clone()));
|
||||||
}
|
}
|
||||||
|
|
|
@ -101,7 +101,7 @@ lazy_static! {
|
||||||
"#
|
"#
|
||||||
).unwrap();
|
).unwrap();
|
||||||
|
|
||||||
pub(crate) static ref HTML_MEDIA_TAGS: Regex = Regex::new(
|
pub static ref HTML_MEDIA_TAGS: Regex = Regex::new(
|
||||||
r#"(?xsi)
|
r#"(?xsi)
|
||||||
# the start of the image, audio, or object tag
|
# the start of the image, audio, or object tag
|
||||||
<\b(?:img|audio|object)\b[^>]+\b(?:src|data)\b=
|
<\b(?:img|audio|object)\b[^>]+\b(?:src|data)\b=
|
||||||
|
@ -284,7 +284,7 @@ pub(crate) fn extract_media_refs(text: &str) -> Vec<MediaRef> {
|
||||||
|
|
||||||
/// Calls `replacer` for every media reference in `text`, and optionally
|
/// Calls `replacer` for every media reference in `text`, and optionally
|
||||||
/// replaces it with something else. [None] if no reference was found.
|
/// replaces it with something else. [None] if no reference was found.
|
||||||
pub(crate) fn replace_media_refs(
|
pub fn replace_media_refs(
|
||||||
text: &str,
|
text: &str,
|
||||||
mut replacer: impl FnMut(&str) -> Option<String>,
|
mut replacer: impl FnMut(&str) -> Option<String>,
|
||||||
) -> Option<String> {
|
) -> Option<String> {
|
||||||
|
|
Loading…
Reference in a new issue