Don't export everything in the lune lib

This commit is contained in:
Filip Tibell 2023-02-05 22:32:10 -05:00
parent 2e3f95ebd6
commit 420a861061
No known key found for this signature in database
5 changed files with 18 additions and 3 deletions

View file

@ -3,7 +3,7 @@ use std::env::current_dir;
use anyhow::{bail, Context, Result};
use serde::{Deserialize, Serialize};
use lune::utils::net::{get_github_owner_and_repo, get_request_user_agent_header};
use super::net::{get_github_owner_and_repo, get_request_user_agent_header};
#[derive(Clone, Deserialize, Serialize)]
pub struct ReleaseAsset {

View file

@ -1,3 +1,4 @@
pub mod files;
pub mod github;
pub mod listing;
pub mod net;

View file

@ -0,0 +1,13 @@
pub fn get_github_owner_and_repo() -> (String, String) {
let (github_owner, github_repo) = env!("CARGO_PKG_REPOSITORY")
.strip_prefix("https://github.com/")
.unwrap()
.split_once('/')
.unwrap();
(github_owner.to_owned(), github_repo.to_owned())
}
pub fn get_request_user_agent_header() -> String {
let (github_owner, github_repo) = get_github_owner_and_repo();
format!("{github_owner}-{github_repo}-cli")
}

View file

@ -3,8 +3,8 @@ use std::{collections::HashSet, process::ExitCode, sync::Arc};
use mlua::prelude::*;
use tokio::{sync::mpsc, task};
pub mod globals;
pub mod utils;
pub(crate) mod globals;
pub(crate) mod utils;
use crate::{
globals::{

View file

@ -7,6 +7,7 @@ pub struct TableBuilder<'lua> {
tab: LuaTable<'lua>,
}
#[allow(dead_code)]
impl<'lua> TableBuilder<'lua> {
pub fn new(lua: &'lua Lua) -> LuaResult<Self> {
let tab = lua.create_table()?;