Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP - Added prompt user for url #17062

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Prev

Added prompt user for url

Fix Cargo.lock corrupted problem

Refactored event handler for CTRL + L

Made sanitize_and_parse_url() handle correctly parse errors

Made the prompt default to the current url

Made sanitize_and_parse_url() return ParseError instead of empty error
  • Loading branch information
jklepatch committed Jun 4, 2017
commit cf174f1f1a3a767188364ea5032bc3a574c92e50
@@ -28,6 +28,7 @@ use std::sync::Arc;
use url::{Url, Position};

pub use url::Host;
pub use url::ParseError;

#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash, HeapSizeOf)]
pub struct ServoUrl(Arc<Url>);
@@ -33,7 +33,7 @@ use servo_config::opts;
use servo_config::prefs::PREFS;
use servo_config::resource_files;
use servo_geometry::DeviceIndependentPixel;
use servo_url::ServoUrl;
use servo_url::{ParseError, ServoUrl};
use std::cell::{Cell, RefCell};
#[cfg(any(target_os = "linux", target_os = "macos"))]
use std::ffi::CString;
@@ -1424,8 +1424,8 @@ fn is_printable(key_code: VirtualKeyCode) -> bool {
}
}

fn sanitize_and_parse_url(url: String) -> Result<ServoUrl, ()> {
ServoUrl::parse(url.trim()).map_err(|_| ())
fn sanitize_and_parse_url(url: String) -> Result<ServoUrl, ParseError> {
ServoUrl::parse(url.trim())
}

#[cfg(not(target_os = "windows"))]
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.